All electromagnetic waves (EM) travel at a speed of approximately 3.0 x 10 8 m/s in vacuum. Although space is not a perfect vacuum, as it is really composed of low-density particles, EM waves, neutrinos, and magnetic fields, it can certainly be approximated as such.
Now, since the average distance between the Earth and the Sun over one Earth orbit is one AU (about 150,000,000,000 m), then it will take about 8 minutes for radiation from the Sun to get to Earth.
Actually, the Sun does not only produce IR, visible light, and UV. Fusion in the core actually gives off high energy gamma rays. However, as the gamma ray photons make their arduous journey to the surface of the Sun, they are continuously absorbed by the solar plasma and re-emitted to lower frequencies. By the time they get to the surface, their frequencies are mostly only within the IR/visible light/UV spectrum.
During solar flares, the Sun also emits X-rays. X-ray radiation from the Sun was first observed by T. Burnight during a V-2 rocket flight. This was later confirmed by Japan’s Yohkoh, a satellite launched in 1991.
When electromagnetic radiation from the Sun strikes the Earth’s atmosphere, some of it is absorbed while the rest proceed to the Earth’s surface. In particular, UV is absorbed by the ozone layer and re-emitted as heat, eventually heating up the stratosphere. Some of this heat is re-radiated to outer space while some is sent to the Earth’s surface.
In the meantime, the electromagnetic radiation that wasn’t absorbed by the atmosphere proceeds to the Earth’s surface and heats it up. Some of this heat stays there while the rest is re-emitted. Upon reaching the atmosphere, part of it gets absorbed and part of it passes through. Naturally, the ones that get absorbed add to the heat already there.
The presence of greenhouse gases make the atmosphere absorb more heat, reducing the fraction of outbound EM waves that pass through. Known as the greenhouse effect, this is the reason why heat can build up some more.
The Earth is not the only planet that experiences the greenhouse effect. Read about the greenhouse effect taking place in Venus here in Universe Today. We’ve also got an interesting article that talks about a real greenhouse on the Moon by 2014.
Here’s a simplified explanation of the greenhouse effect on the EPA’s website. There’s also NASA’s Climate Change page.
NASA Science: The Electromagnetic Spectrum
NASA Earth Observatory