The sun is a ball of hydrogen so big that the gravitational pressure at the center strips electrons from the hydrogen atoms and pushes the protons so tightly together that they stick to each other. The "sticking" eventually creates helium and also releases energy in the form of gamma-ray photons. Those photons make their way through the particles in the sun, losing some energy along the way and finally making their way out of the sun as x-rays, infrared and visible light. The path from the center to the emergence from the sun takes many steps and many years.

Gamma Rays

The creation of helium from hydrogen in the core of the sun is a three-stage process that directly releases one gamma ray and indirectly releases another. Gamma rays are electromagnetic radiation, just like microwaves, radio and light waves, which means they travel at the speed of light: 300,000 kilometers per second (186,000 miles per second). The sun has a radius of about 700,000 kilometers (435,000 miles). So you could reasonably expect a gamma ray to get outside the sun about 2.3 seconds after it is created. But that doesn't happen.

Collisions

In the core of the sun the protons and helium nuclei are so thick that an emitted gamma ray can't get very far before it is absorbed. If you imagine that a gamma ray is emitted right at the center of the sun then it will start out heading right for the surface. When it crashes into a proton the result of the collision is a proton with extra energy. The proton gives up that extra energy by emitting another gamma ray photon. But this one could head in any direction -- even right back where it started from. And so it goes, with the gamma ray heading from one collision to another, changing its direction each time it is absorbed and re-emitted.

The Random Walk

Imagine there's a guy so drunk that he needs to hold on to a light post to stand up. He wants to get to the next light post, just 10 steps away, but he's so drunk that he can't walk in a straight line. Heck, he's so drunk that after he takes one step his next step could be in any other direction. That's what physicists and mathematicians call a "drunkard's walk" or "random walk" problem. The question is, how long will it take that guy to get from one lamppost to the next? The answer is that if his starting point and ending point are separated by 10 steps, it will take him -- on average -- 100 steps to get there -- that's 10 squared. That's the same situation a gamma ray faces in the core of the sun.

Assumptions

When you're trying to solve a random-walk problem, the most important thing you need to know is how big the steps are. There are two problems with figuring that out for a gamma ray photon in the sun. First, conditions are not the same all throughout the sun, so the distance between gamma ray "crashes" with other particles changes. Second, no one has ever visited the center of the sun, so some assumptions need to be made, anyway. There are all sorts of reasonable assumptions, varying from one-tenth of a millimeter to about a centimeter. The choice of this distance has a big impact on the time calculation.

How Long it Takes