To see a model of how this works, make your own miniature greenhouse or "terrarium" out of a clear container. Of course, Earth doesn't work exactly like a terrarium. A terrarium's solid walls contain warm air inside it. But the atmosphere is not a solid barrier. The gases in the atmosphere absorb some of the heat radiated from Earth's surface, and then re-emit some into space and some back towards Earth's surface.
Image Credits:
Photos: AMNH / Matt Tarr
Biodiversity
Brain
Genetics
Marine BiOLogy
MicrobiOLogy
PaleontOLogy
ZoOLogy
AnthropOLogy
ArchaeOLogy
Astronomy
Climate Change
Earth
Physics
Water