Greenhouse gases trap outgoing infrared radiation, causing the greenhouse effect and warming the planet.