Greenhouse gases let the sun’s light shine onto Earth’s surface, but they trap the heat that reflects back up into the atmosphere. In this way, they act like the insulating glass walls of a greenhouse. The greenhouse effect keeps Earth’s climate comfortable. Greenhouse gases (GHGs) are a category of gases that absorb heat energy emitted from the planet's surface and they remain in Earth's atmosphere for a long time (from decades to centuries). The greenhouse effect occurs when Earth's atmosphere traps solar radiation because of the presence of certain gases, which causes temperatures to rise. The greenhouse effect occurs when heat-trapping gases in a planet's atmosphere prevent the planet from losing heat to space, raising its surface temperature. Surface heating can happen from an internal heat source (as in the case of Jupiter) or come from an external source, such as a host star.