There’s a simple story of the greenhouse effect: A blanket of carbon dioxide envelops the planet, letting sunlight in but trapping its heat. The answer is quantum mechanics, which determines whether a molecule can interact with the right type of radiation. A light bulb radiates heat; so does a rock sitting on the ground. The sun is much hotter, about 5,000 degrees Celsius, so it radiates visible radiation with shorter wavelengths. Say some of these molecules are greenhouse gases that interact with the outgoing radiation.