As the electromagnetic radiations from Sun pass through the atmosphere, some of them are absorbed by it while other reach the surface of earth. The range of wavelength which reaches earth lies in infrared region. Thispart of the radiation from the sun has shorter wavelength and can penetrate through the layer of gases like CO2 and reach earth surface. But the radiation from the earth being of longer wavelength can escape through this layer. As a result the earth surface gets warm. This is known as green house effect.