The surface is heated by the Sun and some of that heat radiates back into the air. This makes the temperature higher near the surface than at higher altitudes.
The farther from sea level that you get the
* cooler it is
* warmer it is