How long does it take light to get out from the inside of the Sun?

According to the famous 'drunkard's walk' problem, the distance a drunk, making random left and right turns, gets from the lamp post is his typical step size times the square root of the number of steps he takes. 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 seathing plasma with a central density of over 100 grams/cc. The atoms, mostly hydrogen, are fully stripped of electrons so that the particle density is 10^26 protons per cubic centimeter. That means that the typical distance between protons or electrons is about (10^26)^1/3 = 2 x 10^-9 centimeters. The actual 'mean free path' for radiation is closer to 1 centimeter after electromagnetic effects are included. Light travels this distance in about 3 x 10^-11 seconds. 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. This will take, 5x10^21 x 3 x10^-11 = 1.5 x 10^11 seconds or 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. Also, 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, the time increases a factor of 10!

Typical uncertainties based on 'order of magnitude' estimation can lead to travel times 100 times longer or more. 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 up to 1 million years.

The point of all this is that it takes a LONG time for light to leave the sun's interior!!