Depending on the layer of the atmosphere, the temperature can either decrease or increase at rising altitudes. The five layers of the atmosphere, from lowest to highest, are the troposphere, the stratosphere, the mesosphere, the thermosphere and the exosphere.
In the troposphere, temperatures decrease as the altitude increases as it loses heat emitted from the surface of the Earth. In the stratosphere, the temperature increases with increasing altitude as the amount of ozone-absorbing ultraviolet rays increases. In the mesosphere, temperatures decrease as altitude increases and can reach -194 degrees Fahrenheit. By contrast, temperatures in the thermosphere can reach over 2,700 degrees Fahrenheit.