In my experience so far, I have found a pretty fast way to level up. All you need to do is progress with the Minutemen far enough until you have taken the Castle. Don't worry, going this far will NOT hurt your reputation with any of the other factions. Now, after you have taken the Castle, Preston should have gone back to Sanctuary (at least he did in my case). At this point, he will keep feeding you quests either telling you to go clear out a new settlement, or help an existing one in some way. Depending on your Int level, you can get a pretty nice Exp bonus from farming these quests. I have 8 Int and I am averaging about 150 exp per quest completed. Plus, all of the experience you will get from killing all of the required enemies in each quest. I have gone from 39 to 42 in just over an hour. It's not lightning, sure, but it's the quickest way I have found so far without breaking the game.
WAY #2. Alright, here's for you folks that feel you need to break the game to hit 50. It's simple, all you need to do, is get a decent sniper rifle (make sure it has a long scope, too), and join the Brotherhood of Steel. Set the game to easy and progress until you hit the Learning Curve quest. What the quest will have you do is protect a fellow Knight using your shiny rifle from the deck of a ship. What you WANT to do, though, is crouch and make sure you are HIDDEN. Once you are, your only goal in life should be to team kill the hell out of your friend. Make sure you are HIDDEN before each shot!!! What this does is, if you are UNSEEN, it will just end the quest. You can now go back to Quinlan and claim your 300 exp reward, AND you can do it over, and over again to your hearts content. You should get the 300 exp in all of 90 seconds per run. EASY level 50!
Video for reference: (it isn't mine)
A couple of shootouts from the comments here:
Both Illustrious Yeti and South Park TFBW have added that you can get the idiot savant perk, and rank it up so you get the 5x bonus, and right before you turn the quest in, save and turn the quest in. If you don't get the bonus, you can reload and try again to get the bonus! Handy!
On the other, brighter end of the spectrum, A Giant Radroach suggests that you can also max out your Int, get the night person perk for even more intelligence, wear the Vault Tec lab coat for even MORE, and sleep with your lover to get a pretty consistent exp bonus to make it go a little faster. So many options!