Greenhouse gases in the atmosphere (including carbon dioxide, methane, and water vapor) absorb the infrared light and then re-emit it in random directions. Some escapes to space, and some remains ...