The temperature of the Earth’s atmosphere varies with altitude; the mathematical relationship between temperature and altitude varies among five different atmospheric layers (ordered highest to lowest, the ionosphere is part of the thermosphere):
Exosphere: from 500 – 1000 km (300 – 600 mi) up to 10,000 km (6,000 mi), free-moving particles that may migrate into and out of the magnetosphere or the solar wind.
Ionosphere: the part of the atmosphere that is ionized by solar radiation. It plays an important part in atmospheric electricity and forms the inner edge of the magnetosphere. It has practical importance because, among other functions, it influences radio propagation to distant places on the Earth. It is located in the thermosphere and is responsible for auroras.
Thermosphere: from 80 – 85 km (265,000 – 285,000 ft) to 640+ km (400+ mi), temperature increasing with height.
Mesosphere: From the Greek word “μέσος” meaning middle. The mesosphere extends from about 50 km (160,000 ft) to the range of 80 to 85 km (265,000 – 285,000 ft), temperature decreasing with height. This is also where most meteors burn up when entering the atmosphere.
Stratosphere: From the Latin word “stratus” meaning a spreading out. The stratosphere extends from the troposphere’s 7 to 17 km (23,000 – 60,000 ft) range to about 50 km (160,000 ft). Temperature increases with height. The stratosphere contains the ozone layer, the part of the Earth’s atmosphere which contains relatively high concentrations of ozone. “Relatively high” means a few parts per million—much higher than the concentrations in the lower atmosphere but still small compared to the main components of the atmosphere. It is mainly located in the lower portion of the stratosphere from approximately 15 to 35 km (50,000 – 115,000 ft) above Earth’s surface, though the thickness varies seasonally and geographically.
Troposphere: From the Greek word “τρέπω” meaning to turn or change. The troposphere is the lowest layer of the atmosphere; it begins at the surface and extends to between 7 km (23,000 ft) at the poles and 17 km (60,000 ft) at the equator, with some variation due to weather factors. The troposphere has a great deal of vertical mixing because of solar heating at the surface. This heating warms air masses, which makes them less dense so they rise. When an air mass rises, the pressure upon it decreases so it expands, doing work against the opposing pressure of the surrounding air. To do work is to expend energy, so the temperature of the air mass decreases. As the temperature decreases, water vapor in the air mass may condense or solidify, releasing latent heat that further uplifts the air mass. This process determines the maximum rate of decline of temperature with height, called the adiabatic lapse rate. The troposphere contains roughly 80% of the total mass of the atmosphere. Fifty percent of the total mass of the atmosphere is located in the lower 5.6 km of the troposphere.
The average temperature of the atmosphere at the surface of Earth is 15 °C (59 °F).