The electromagnetic radiation from the sun has a short wavelength. The radiation is absorbed by and warms up the earth. The earth the re- radiates this energy as Infrared radiation of a longer wavelength. This longer wavelength radiation is absorbed by green house gases which warm up the atmosphere.