Why is the air colder at a greater altitude?
Since air is "clear," sunlight passes through it easily and heats the ground. The atmosphere then gets heated from the ground and the atmosphere is warmer near the ground. As warm air rises from the ground, it expands and cools, and the sum result is colder air at higher altitudes than at the surface.
Steven Businger, Professor of Meteorology
Department of Meteorology
University of Hawaii, Honolulu HI 96822