Energy created by fusion in sun's core is carried out by particles of light is called photon. They bring warming sun-ray to earth. First they have to travel all the layers of the sun. First layer is 185 thousand miles thick radiative zone. It is so dense that those photons continuously collide with Hydrogen and Helium. It struggles outward with chaotic zigzag pattern called random walk. As photons reaches to edge where density is less its collision decreases and becomes easier for photon to get out.
Then photons enter 130th miles within sun's surface called the convective zone. In this layer photon's speed is suddenly increased. They are carried upwards by a tide of boiling gas. So it takes only 10 days to emerge on solar surface. From there Photons take only 8 minutes to travel 93 million miles of space to reach our planet. But the age of photons reached earth is already 100 or 1000 years.