Never shot the Ruger. But I LOVE my M&P9. It's just a well made gun. Fit, Finish, Accuracy. The S&W probably does cost more. I don't own any Rugers. I've looked at them and they just dont stand out for me.
But I'm sure you wouldn't be disappointed with either. Both companies have a fine rep for quality and customer service.