Thermal energy is transferred from hot places to cold places by convection. Convection occurs when warmer areas of a liquid or gas rise to cooler areas in the liquid or gas. Cooler liquid or gas then takes the place of the warmer areas which have risen higher. This results in a continous circulation pattern. Water boiling in a pan is a good example of these convection currents. Another good example of convection is in the atmosphere. The earth's surface is warmed by the sun, the warm air rises and cool air moves in.