# Why does it takes so much time for photons to reach surface of sun from its core?

I have read somewhere that the time taken by photons to reach the surface of sun is very large as compared to time it takes to reach earth from the surface of sun . Is the presence of dense gases in sun reason for that.

This means that the distance a photon reaches after a certain amount of time is given roughly by: $$D(t) = \lambda_\text{MFP} \sqrt{N_\text{coll}},$$ where $$\lambda_\text{MFP}$$ is the mean free path of the the photon, and $$N_\text{coll}$$ is the number of collisions in time $$t$$.
As $$N_\text{coll} \propto \lambda_\text{MFP}$$ and $$\lambda_\text{MFP} \propto 1/n$$, where $$n$$ is the particle density, diffusion length $$D(t)$$ will increase very slowly for something as dense as the sun.