sunlight passes through the atmosphere and warms the earth. infrared radiation is given off by the earth and most escapes to outer space, allowing the earth to cool, but some infrared radiation is trapped by gases in the air, keeping the earth warm enough to sustain life.