The atmosphere is composed of mostly nitrogen and oxygen, with traces of other gases such as carbon dioxide. There are several layers to the atmosphere.
Troposphere: This is the layer of the atmosphere closest to Earth, about seven miles thick. The temperature of the troposphere decreases the farther away from Earth you go. Weather phenomena, such as clouds, mainly occur in the troposphere.
Stratosphere: This layer is beyond the troposphere, about seven to 30 miles from Earth. This layer contains the ozone layer, a region with relatively high levels of ozone (O3), which absorbs ultraviolet light from the Sun. As a result, the higher levels of the stratosphere are typically a little warmer than the lower levels, though the average temperature is around 32 degrees F.
Mesosphere: This layer is beyond the stratosphere, and quite thin. As with the troposphere, the temperature is colder the farther away from Earth you get. The air here is quite thin and below freezing temperatures.
Thermosphere: This layer is beyond the mesosphere and even thinner than the mesosphere. Like the stratosphere, this layer gets hotter at higher altitudes. This is due to particles absorbing electromagnetic radiation from the Sun; because the air is so thin, there is a lot of room to move once radiation is absorbed, and the increased movement of particles increases the temperature.
Exosphere: In this layer the atmosphere blends with space.