Check this older thread also for some perspective and useful advice:
http://news.ycombinator.com/item?id=348774
Even if you want to get into research, leave all ideals and preconceived notions behind. As others have said, doing a phd is depressing as hell. You will have smart people to hang out with every day, but especially if you are thinking of real world applicability of things, you might have a hard time connecting with most of them.