Heat through sun reaches earth in form of infrared radiations of higher frequency range approx 1014Hz. This heat is absorbed by solids on earth's surface and they re-radiate this heat in form of infrared radiations of lower frequency range approx 1010Hz. These radiations are absorbed by greenhouse gases like methane and does not escapes into space causing warming of earth's atmosphere.