Online Astronomy eText: The Sun
Heat Flow in the Solar Interior Link for sharing this page on Facebook
Changes in Brightness, Temperature, Pressure and Density
      The energy of the Sun is produced in the core (the innermost 10% or so of its mass and radius), through the fusion of hydrogen to helium. It then flows outward, toward the surface, where it is radiated into space. On the average heat must be created in the core, flow from layer to layer and be lost at the surface at the same rate in every part of the Sun. Otherwise, various parts of the gases in the solar interior will heat up and expand or cool off and contract.
      To ensure that the flow is more or less constant, the brightness of the Sun must increase as you go inward by about the same brightness that it has at the surface for each "layer" downwards (a layer being defined as approximately the distance that you can see downwards at any given point).
      To see how this works, imagine that you are at the surface of the Sun. Heat is flowing in all directions at a rate of a little over 5 million watts per square foot (the luminosity of the Sun, a little less than 400 trillion trillion watts, divided by its surface area, a little more than 70 million trillion square feet). As heat flows outwards into space it must be replaced by heat from below, so there must be a net outflow of a little over 5 million watts per square foot from the layer below the surface to the surface itself. But in the region below the surface heat is flowing in two directions -- downwards at the surface heat flow rate, from the surface, and upwards at the heat flow rate for the next layer down, toward the surface. Therefore, in order for the net heat flow outward to equal the surface heat flow, the heat flow from the layer below the surface must be twice as great as that at the surface.
      The above discussion is a bit simplified in a number of ways, but correctly leads to the conclusion that as we head into the Sun each layer must be brighter than the layer above it by an amount approximately equal to the surface brightness. As a result, by the time that we are in the center of the Sun, approximately 15 trillion layers below the surface (defining each layer as the distance that you can see downward from the bottom of the layer above), the brightness must be of the order of 15 trillion times greater per square foot than at the surface.
      To accomplish this increase in brightness, the temperature must increase, and as a result every step of the way down into the Sun a number of quantities must increase -- the brightness, the temperature, the density, and the pressure.
      The increase of brightness and the corresponding increase in temperature are summarized above. The increase in pressure is required, because the pressure must everywhere be equal to the weight of the gases above a given region, and of course the further down you are, the greater that weight will be. The increase in density is required because to increase the pressure, you need to increase either the density or the temperature or both, and as it turns out, the temperature doesn't increase fast enough to take care of the problem. At the center, the temperature is only about 2500 times hotter than at the surface, while the pressure is hundreds of billions of times greater. As a result, the density has to increase by many tens of millions of times, therefore being the main way in which pressure increases.

The Flow of Radiation
      The outward flow of radiation from the core is continually blocked by collisions with the gas particles in the interior of the Sun (primarily the electrons, whose low mass makes htem "look" much larger than the nuclei (in a quantum mechanical sense), and are therefore more effective at blocking the light). Near the surface the gas is spread out and the light photons may travel several miles between collisions, allowing us to see a long distance -- but near the center of the Sun the gas is extremely dense (more than 100 times the density of water), and the light photons travel only a fraction of an inch between collisions.
      Since, in the deep interior every direction is "out", if the light could just keep going in a given direction for any length of time, it could escape from the Sun in very little time (in fact, in less than 3 seconds). But because the light bounces from particle to particle, over and over and over again, its total path length is tremendously increased (in fact, by about the number of "layers" that it has to pass through, or about 15 trillion times), slowing it down tremendously (by that same 15 trillion times), and causing it to take more like 40 trillion seconds, which is more than a million years, to go from the center of the Sun to the surface, and escape.
      Since the light takes so long to get out of the Sun, and has to undergo so many collisions (approximately the square of the number of layers, or about 200 trillion trillion collisions per photon), it would hardly be surprising if it was in some way affected by its passage through the gas. And in fact in any given part of the Sun the continual interaction between the light and the gas results in something called Local Thermodynamic Equilibrium -- meaning that on the average, all measures of temperature, such as the average energy of motion of the gas particles, or the average energy of the light photons, must be about the same.
      To see how this works imagine that we take two gases, a cold one and a hot one, and mix them together. In the cold gas the particles are moving slowly with low energies, and in the hot gas the particles are moving quickly with high energies. As the particles of the two gases collide energy is exchanged, with an average transfer from the more energetic particles to the less energetic ones (only on the average -- sometimes it works the other way around), causing the mixed gas to end up with more nearly average energies for the particles and their motions, and a corresponding average or in-between temperature.
      The same thing happens if a "gas" consisting of photons passes through a gas consisting of ordinary particles, such as atomic nuclei and free electrons. In most of the collisions between the photons and the gas particles, nothing will happen, save a random change in the direction of motion of the photons, but in a very small fraction of the collisions there is an exchange of energy, and if there are enough such exchanges, the average energy of the photons and of the gas particles will become equal.
As a result, on its long journey from the center of the Sun, where the temperatures (and the gas particle energies) are very high, toward the outer layers where the temperatures (and the gas particle energies) are low, the photons passing through the gas are gradually transformed from high-energy photons to low-energy photons. Note that the TOTAL energy doesn't change, so the number of photons must gradually increase (though the mechanism by which that is accomplished is outside the scope of this brief discussion).
      So in the core of the Sun we have very high temperature gases in which nuclear fusion reactions are taking place, creating gamma radiation (as discussed in your text). As the radiation (photons) streams through the gas, it is quickly transformed into radiation which has an average energy spectrum equal to that of the gas through which it is moving, and over the next million years or so, as it slowly diffuses (randomly moves from place to place, spreading throughout the Sun) toward the surface, it gradually transforms, so that it is always in equilibrium with its surroundings. And when it finally passes through the topmost layer (or "surface") of the Sun, the energy distribution (and spectrum) of the light leaving the Sun is almost identical to so-called
Black Body Radiation corresponding to the temperature of the Solar surface.

(Note: This discussion assumes that the only way that photons move from the core of the Sun to the surface is through random interactions or collisions with the gas particles in their way. As will be seen in the page discussing convective motion within the outer part of the Sun, there are other ways to move the energy outward; but they do not change the basic results discussed above, nor the fact that when the light finally leaves the Solar surface it has a spectrum almost identical to black-body radiation corresponding to the "surface temperature" of the Sun.)