Power off the phone, remove the battery, put the battery back in and see if the same thing happens
If it keeps happening, determine whether it's the chargin or a runaway app that is causing the heat. Install Watchdog Lite from the Market and see if it reports any misbehaving apps. It will alarm show and sound a notification if an app's CPU utilization is high.
If you see an alarm for an app, uninstall the app and see if the problem goes away.
If you do not see an alarm, open Watchdog Lite, tap the CPU button, then turn on the "Real time CPU" checkbox to see a second-by-second listing of the apps that use the most CPU. If any app remains above about 5% or so for more than a few seconds, that app may be the culprit. Uninstall that app and see of the problem goes away. Note that Watchdog Lite's CPU utilization will be high during while the checkbox is ON. You can ignore that.