The atmosphere exhibits distinct vertical layers with characteristic temperature profiles driven by how different constituents absorb solar radiation and emit terrestrial radiation. The troposphere, where most weather occurs, typically shows decreasing temperature with altitude, while the stratosphere shows increasing temperature due to ozone absorption of ultraviolet radiation. This thermal structure fundamentally controls atmospheric density, pressure, and dynamic behavior.
You know from studying atmospheric composition that Earth's atmosphere is a mixture of gases held in place by gravity, and from thermal equilibrium that objects exchange energy until they reach a balanced temperature. The thermal structure of the atmosphere is the vertical temperature profile that results from these energy exchanges — and it is not uniform. Different layers of the atmosphere gain and lose energy in fundamentally different ways, creating a layered temperature structure that governs nearly everything about weather and climate.
The troposphere extends from the surface to about 12 km altitude (higher in the tropics, lower at the poles) and is where virtually all weather occurs. Temperature generally decreases with altitude here, at an average rate of about 6.5°C per kilometer. This happens because the troposphere is heated primarily from below: the sun's energy passes through the atmosphere relatively freely, warms the ground, and the ground then warms the air above it through conduction and radiation. Air farther from the surface receives less of this heating, so it stays cooler. The troposphere is also well-mixed by convection — warm surface air rises, cool upper air sinks — which is why "troposphere" comes from the Greek word for "turning."
At the top of the troposphere sits the tropopause, a boundary where temperature stops decreasing and begins to increase. Above this lies the stratosphere, extending to about 50 km. The stratosphere's warming-with-altitude profile is caused by the ozone layer, which absorbs ultraviolet radiation from the sun and converts it to heat. This energy source is located within the stratosphere itself rather than below it, so the warmest air sits at the top. This temperature inversion makes the stratosphere extremely stable — there is almost no vertical mixing, which is why volcanic ash and injected aerosols can linger there for years, and why commercial aircraft fly near the tropopause to avoid turbulence.
Above the stratosphere, the pattern alternates again. The mesosphere (50–85 km) cools with altitude because ozone concentration drops off and there are few molecules to absorb radiation, making it the coldest layer of the atmosphere (down to −90°C at the mesopause). The thermosphere above 85 km warms dramatically as sparse gas molecules absorb extreme ultraviolet and X-ray radiation, reaching temperatures above 1000°C — though the air is so thin that this "temperature" would not feel hot. Each boundary between layers — tropopause, stratopause, mesopause — marks a reversal of the temperature trend, and these reversals define the atmosphere's fundamental dynamic behavior: where convection is vigorous, where the atmosphere is stable, and where energy is exchanged between layers.