All of the sun’s photons are generated through nuclear reactions within it. If a photon is generated at the centre of the sun it can take anywhere between 2 days and 200,000 years to escape the body of the sun.
That’s because the path of the photon is purely probabilisitic. At the centre of the sun the pressure and temperature are enormous. The density of hydrogen atoms is also enormous. Consequently, every photon encounters many, many trillions of hydrogen atoms before finally escaping.
Each time it interacts with a hydrogen atom its path is deflected. And so it ‘bounces’ along inside the sun until its path leads to the door out (this is called ‘scattering’).
The speed of light, in free space, is approx 299,792.458 km/s (which is about 186,282 miles per second in old money!). However, at the sun’s centre this can be as slow as a few centimetres per second, due to the huge densities in there.
As the photon moves towards the sun’s surface the density reduces markedly. Its speed increases but it still scatters off many hydrogen atoms. Finally, it will scatter off its last hydrogen atom and escape from the sun’s atmosphere into free space, where it will reach the speed of light.
Around eight minutes later, if it’s going in the right direction, it will enter the Earth’s atmosphere and slow down again (just a little bit!). If it is particularly unlucky the poor photon will reflect off some object (could be a window, a car, a mirror or even just water on the ground) and disappear up someone’s left nostril!!
Once that happens it will likely be absorbed in the tissues within said nostril! At that point it will disappear forever from the history if the universe.
Its brief, yet exciting, life will have ceased.
And so is the life of a solar photon….
(Footnote – of course, the original photon disappears quite early in its ‘life’! In actuality, it is absorbed and re-emitted as a new photon many, many times during its passage through the sun. But why ruin a good story with mere things like facts!!!?)