The radiation field in the interior of a star always has a blackbody spectrum, because the interactions between matter and radiation rapidly bring the electromagnetic radiation into thermal equilibrium with the electrons and ions. In the absence of convection, this radiation field provides the mechanism of transporting energy out of the star. The radiation diffuses in the direction of lower temperature, which means it diffuses to the star's surface, where it can freely escape into space.
Diffusion is a randomwalk process. For instance, a photon that interacts only through Compton scattering will move a small distance in one direction, scatter with an electron, and then move a similar distance in a new, random direction. To move a large distance from its starting point,?meaning many times the distance traveled between scatterings? the photon must random walk a distance many times longer. This random walk also holds for absorption and emission, because photons are emitted into random directions; energy absorbed from a photon moving in one direction will be released as a photon moving in a new direction.
An estimate of how far photon must random walk to travel a given distance away from a starting point can be calculated from the ratio of the distance traveled way from a source divided by the average distance traveled between scatterings. This ratio would give the number of scatterings if the photon had continued on in the same direction after each scattering. In a random walk, a photon must travel this ratio squared times the average distance between scatterings to move our required distance from its source. This is equivalent to random walking our required distance times the ratio of this distance to the average distance traveled between scatterings. In a star, the distance between scatterings is very small, while the distance across the star is very large, so a photon must randomwalk a distance that is many times the distance across a star. At the core of the Sun, a photon undergoes 10^{15} Compton scatterings per second, and over 1 second, it diffuses about 5 meters from its starting point. A photon in the Sun requires about 10^{30} scatterings to escape the core, which takes of order 10 million years.
The radiation diffuses most rapidly where the interaction of radiation with matter is weakest. The diffusion is fasted when Compton scattering is the only mechanism of interaction. As the temperature drops, so that bremsstrahlung, photoionization, and atomic transition processes become prevalent, the interaction between radiation and matter becomes more frequent, and the diffusion becomes slower.
Diffusion is faster at some photon frequencies than others. For instance, diffusion at the frequence of an atomic transition is much slower than at frequency wellaway from an atomic transition. At higher temperatures, diffusion is fastest for the highestenergy photons, because lowenergy photons interact with electrons through the bremsstrahlung process more strongly than do the highenergy photons.
The diffusion of energy is always in the direction of lower temperature. The reasons are that as the temperature drops, the density of photons drops, because the density of photons is proportional to T^{3}, and the average energy carried by a photon drops proportionally with temperature. The the number of photons randomwalking from a hightemperature area into a lowtemperature area is much larger than the number of photons randomwalking from a lowtemperature area to a hightemperature area, and the average energy carried by the hightemperature photons to the lowtemperature area is greater than the average energy carried from the lowtemperature area to the hightemerpature area by lowtemperature photons.
The power diffusing through the radius r inside the star is described by the equation
L(r)  =  4 r^{2} 
 T^{ 3} 

. 
In this equation, a = 7.56510^{15} ergs cm^{3} deg^{4} is the StefanBoltzmann constant, c is the speed of light, is the mass density of material, κ is a constant called the Rosseland mean opacity, and T is the temperature. This equation explicitly shows that the power flowing through a particular radius is proportional to the temperature at that radius. What is not show is all of the complex physics associated with the interaction of radiation with matter; this is hidden in the Rosseland mean opacity. The Rosseland mean opacity describes the strength of the interactions between radiation and matter, with the weakest interactions contributing most strongly to the parameter. It is a function of both density and temperature. The only time it has a simple form is when the dominant contribution is from Compton scattering for temperatures well below the electron restmass energy. In this case, the Rosseland mean opacity is a constant. The diffusion equation is one of the principle equations for deriving the internal structure of a star.