I covered this subject in a TedEd video that you can view on YouTube.com
called Sunlight is Way Older than you Think!
The basic idea is pretty simple.
According to the famous 'Random Walk' problem, the distance a particle,
making random left and right turns, gets from a specific point in space is its typical step size times
the square root of the number of steps the particle jumps. If this step is one meter long, it will take
100 steps to travel 10 meters from a point in space, and 10,000 steps to travel 100 meters.
For the sun, we know how far we want to go to get out....696,000 kilometers, we just need
to know how far a photon travels between emission and absorption, and how long this step takes.
This requires a bit of physics!
The interior of the sun is a seething plasma with a central density of over 100 grams/cc.
The actual distance that an x-ray or gamma-ray photon can travel is between 1 centimeter
and 1 millimeter. Very approximately, this means that to travel the radius of the Sun, a
photon will have to take (696,000 kilometers/1 centimeter)^2 = 5 x 10^21 steps. Now,
light travels 3 x 10^10 centimeters/second, so this will take, 5x10^21 steps x 3 x10^-11 seconds/step = 1.5 x 10^11 seconds. Since there are 3.1 x 10^7 seconds in a year, you get about 4,000 years.
Some textbooks refer to 'hundreds of thousands of years' or even 'several million years' depending on what is assumed for the mean free patch.
There are many approximations that enter into these calculations. The interior of the sun is not at constant density so that the steps taken in the outer half of the sun are much larger than in the deep interior where the densities are highest. Note that if you estimate a value for the mean free path that is a factor of three smaller than 1 centimeter ( i.e 3 millimeters), the time increases a factor of 10 to 40,000 years.
X-rays and gamma rays take different step lengths because the opacity of the Sun is different to these two forms of radiation emitted by the core.
Typical uncertainties based on this 'order of magnitude' estimation can lead to travel times 100 times longer or more, and travel times approaching a million years.
Most astronomers are not too interested in this number and forgo trying to pin it down exactly because it does not impact any phenomena we measure with the exception of the properties of the core region right now. These estimates show that the emission of light at the surface can lag the production of light at the core by about 100,000 years or so.
Return to Dr. Odenwald's FAQ page at the Astronomy Cafe Blog.