The sun heats the Earth by shining light on it and radiating heat toward it. The atmosphere absorbs the heat, keeping it close to the Earth's surface where it can sustain life. Without heat and energy from the sun, life on Earth would not exist. Light energy not only warms the planet, it supplies the calories that are consumed by every living thing on the planet.
Several types of light shine on the Earth thanks to the sun, including infrared light, ultraviolet light and visible light. Because it is simple energy, light is transformed into heat once it reaches the surface of the Earth. This is why the temperature is warmer when the sun is shining.
In addition to light rays, the sun also emits radiation in the form of X-rays, microwaves and radio waves. When radiation reaches the atmosphere, the molecules of the atmosphere heat up, causing the molecules around them to become warm as well. The process that causes the atmosphere to warm up is called conduction, according to UCSB ScienceLine. Because there are no atmospheric particles for radiation to interact with in space, it remains quite cold even though the energy that warms the Earth passes right through it.