The condition that develops when infrared rays are trapped in the atmosphere causing it to heat up is called the greenhouse effect. The greenhouse effect occurs when certain gases, such as carbon dioxide and methane, absorb infrared radiation and trap heat in the atmosphere. This causes the Earth's temperature to rise, leading to global warming and climate change.