Greenhouse gases are gases in Earth's atmosphere that trap heat. They allow sunlight to pass through and warm the Earth's surface, but they prevent some of the heat from radiating back into space, thus warming the planet. Carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O) are major greenhouse gases.