This is an actual message that you may see! If you iPhone is in extreme tempatures such as:
“Operate iPhone 3G in a place where the temperature is between 0º and 35º C (32º to 95º F) … If the interior temperature of iPhone 3G exceeds normal operating temperatures, you may experience [the] Temperature warning screen.” – Apple’s Knowledge Base
All you can do is get the iPhone out of the extreme tempature and let it cool down to normal operating temperatures.