
Nuclear reactions in the Sun’s core produce light and other types of radiation. As light photons leave the core, they run into electrons and atomic nuclei, scattering off each one. These interactions cause photons to take, on average, 200,000 years to move from the Sun’s core to its surface.
Astronomy: Roen Kelly
The speed of light is constant, but the problem is that the light (or more generally, radiation) doesn’t travel directly from the Sun’s center to the surface. The light that originates at the Sun’s core is scattered many times — sometimes toward the surface, sometimes back toward the core, sometimes sideways — before finally arriving at the surface and escaping into space.