Summary
Highlights
The Moon experiences vast temperature swings, from 120°C during the day to -170°C at night, despite being the same distance from the sun as Earth. Earth, in contrast, maintains a much smaller temperature range, with a global average of 16°C.
The Earth's atmosphere is responsible for this temperature difference. It protects us from excessive solar energy and traps some of the heat, ensuring temperatures don't drastically fall at night, especially when it's cloudy.
Solar energy arrives as electromagnetic radiation. The upper atmosphere absorbs most wavelengths, but visible light penetrates. About one-third of this visible light is reflected back by clouds and ice. The remaining half warms the Earth's land and oceans, which then re-emit this energy as low-energy infrared radiation (heat).
While oxygen and nitrogen don't absorb this infrared radiation, greenhouse gases like carbon dioxide, methane, nitrous oxide, and water vapor do. Their molecules absorb the infrared waves, vibrate, and then re-emit new infrared waves in random directions. This process means heat gets trapped near the Earth's surface for longer.
Despite making up less than one percent of the air, greenhouse gases within a six-kilometer atmospheric layer effectively trap heat, preventing most from escaping into space. This 'greenhouse effect' keeps Earth significantly warmer, with an average temperature of 16°C, as opposed to a frigid -18°C without it.