First, sunlight shines onto the Earth's surface, where it is absorbed and then radiates back into the atmosphere as heat. In the atmosphere, “greenhouse” gases trap some of this heat, and the rest escapes into space. The more greenhouse gases are in the atmosphere, the more heat gets trapped.