Global surface temperatures in 1950 (top) and 1998 (bottom). Colors represent departures from normal temperature. Courtesy of NASA - Goddard Space Flight Center Scientific Visualization Studio
From a physics perspective, global warming is a matter of heat balance: the earth's temperature naturally rises until the heat flowing out of the earth balances the heat flowing into it. If the earth can't get rid of heat as fast as new heat arrives, the earth will get hotter, which means that anything that slows the earth's ability to eliminate heat causes its temperature to rise.
Since the earth is an isolated object, suspended in space far from anything else, the only way it can exchange heat with the rest of the universe is through thermal radiation—the emission and absorption of electromagnetic waves. Heat flows from the sun to the earth via thermal radiation and from the earth to the depths of space via thermal radiation. The rate at which heat flows to the earth is determined mostly by the sun's properties. But the rate at which the earth radiates away heat is determined by the earth's properties. To begin with, the earth's temperature affects its heat loss; the hotter the earth is, the faster it radiates away heat. But also important is the ease with which the earth's thermal radiation escapes into space. If some of that thermal radiation is caught by the earth's atmosphere before it can escape and its energy returned to the earth, the earth will have to become hotter in order to lose heat as fast as heat arrives.
The presence of complicated molecules in the earth's atmosphere impedes the earth's ability to radiate thermal energy into space. By complicated molecules, I mean ones that have vibrations that allow them to absorb infrared light. The most abundant molecules in our atmosphere, nitrogen and oxygen, don't do that. However, molecules such as carbon dioxide and methane do and because each of these molecules absorbs its own unique spectrum of electromagnetic wavelengths, it contributes to the problems the earth has in getting rid of heat.
These molecules are known as greenhouse gases because they act like the windows of a greenhouse: they trap thermal radiation and force the greenhouse to become hotter before it's able to reach heat balance. Water is the main greenhouse gas in the atmosphere and we should be grateful for its presence. If it weren't for atmospheric water, the average surface temperature of the earth would be just –18 °C (0 °F). But other complicated molecules are also important, even when they're relatively rare. That's because each molecule has a unique absorption spectrum and can absorb wavelengths that the other molecules ignore. Carbon dioxide, methane, nitrogen oxides, chlorofluorocarbons, and hydrofluorocarbons all act as greenhouse gases, trapping heat along with water and raising the earth's average temperature to about 15 °C (59 °F) or more. And as greenhouse gases increase, so will the earth's temperature.
There is another interesting way to understand the greenhouse effect. The earth is heated primarily by visible light from the sun and that visible light is absorbed mostly at the earth's surface. But the earth emits its thermal radiation primarily as infrared light and this infrared light is emitted mostly from the atmosphere at an average altitude of about 5 kilometers. To maintain heat balance, the atmosphere at an altitude of 5 kilometers must have an average temperature of –18 °C (0 °F), the same temperature that the earth's surface would have if there were no atmosphere. But because the temperature of the atmosphere decreases with altitude by about 6.6 °C per kilometer, the earth's surface temperature must have an average value of about 15 °C (59 °F) in order for the atmosphere to have the right temperature at 5 kilometers.
Unfortunately, adding more greenhouse gases to the atmosphere raises the average altitude from which the earth's thermal radiation emerges and thus increases the earth's average surface temperature. Concern over this rising temperature is making people think twice before adding more complicated molecules to the atmosphere for fear of causing catastrophic climate change. From a physics perspective, global warming is a matter of heat balance: the earth's temperature naturally rises until the heat flowing out of the earth balances the heat flowing into it. If the earth can't get rid of heat as fast as new heat arrives, the earth will get hotter, which means that anything that slows the earth's ability to eliminate heat causes its temperature to rise.
Answered by Lou A. Bloomfield of the University of Virginia.