Did you know that a mountain top may be toastier than the valley below? Several factors contribute to temperature at different altitudes.
Vertical Heat Loss
Higher altitudes are typically colder. That's because in the bottom ten or so miles of the atmosphere, air mixes vertically--cold air sinks, and hot air rises. As the ground bakes in the sun, the air right above it heats up and starts to rise, and as it gets higher, it experiences a decrease in pressure that allows it to expand and lose heat. And the more air expands, the colder it becomes. The exception to this is if the air contains a lot of moisture. In this case, all that cooling will result in condensation and cloud formation, a process that gives off heat and prevents the air from cooling as quickly.
The temperature on top of a mountain also depends on the way sunlight hits the mountain. If the mountain you're on slopes away from the sun, the air directly above its surface can become relatively cold and drain into the valley below, cooling it off as well. Also, low-lying clouds can block the sun from reaching the valley bottom and heating it up.
"Heat" (School For Champions)