I had this problem even after a new phone, but solved with below:
After backing up your phone, Settings->General->Erase All Content and Settings.
Then set up as a new phone.
DO NOT RESTORE from backup as you may be bringing the problem that was causing the overheating back on your phone.
Slowly add your most favorite apps from the App Store, waiting a day or so to make sure your problem isn't caused by a bad app.
If this doesn't work, take your phone to the Genius' for a new battery/phone.
BEWARE. When you backup your phone, it isn't that easy to get to some of your important data like documents in your favorite programs or photos if you are not using photo stream so pull those out of iTunes.