@OP, clear cache, clear data and do a factory reset. Take out the battery clean the contacts.
The overheating can mean either of two things:
1. the CPU is stuck in the high performance mode
2. The battery is overheating
Now if the CPU is stuck at high performance mode (1.2 ghz), it may be because of some app that has frozen and in turn is eating up all the resources. In this case a simple restart (hard restart- where you take out the battery for 5 mins after switching off the phone) will likely fix it. Another reason could be a faulty motherboard, where excessive current leaks is causing the overheating. This scenario is very very unlikely.
If the battery is overheating, then it might be a problem with the battery contacts or with the battery stats. If the problem is with the contacts, then cleaning the contacts will fix it else if its to do with the battery stats, then you need to do a factory reset as well as clearing of dalvik cache and then reset the battery stats with an app. But you will need root for this.
In case you are not rooted, then do a factory reset from the stock recovery (at full charge) (to get into recovery press vol up + home + power all together when the phone is switched off), clear cache and then use the phone till you have drained approx 90% of the battery ie only 10% or so is left. Next switch off the phone and charge till 100%, then take off charger, switch the phone on and again charge till the voltage in the battery dont change (u can use current widget for this, it should be around 4200mV). Your problem will be fixed.
Battery stats gets screwed if you have the habit of topping off charge in stead of doing a complete charge-discharge cycle. So even if you charge completely , your battery is not getting fully charged due to the corrupted battery stats and hence starts leaking current thereby causing overheating.
Hope this helps