The sun -- the most massive object in the solar system -- is a [population I yellow dwarf star](http://www.universetoday.com/16350/what-kind-of-star-is-the-sun/). It's at the heavier end of its class of stars, and its population I status means it contains heavy elements. The only elements in the core, however, are hydrogen and helium; hydrogen is the fuel for nuclear fusion reactions that continuously produce helium and energy. At present, the sun has burned about half of its fuel.
How the Sun Formed
According to the nebular hypothesis, the sun came into being as a result of the gravitational collapse of a nebula -- a large cloud of space gas and dust. As this cloud attracted more and more matter to its core, it began to spin on an axis, and the central part began to heat up under the enormous pressures created by the addition of more and more dust and gases. At a critical temperature -- 10 million degrees Celsius (18 million degrees Fahrenheit) -- the core ignited. The fusion of hydrogen into helium created an outward pressure that counteracted gravity to produce a steady state that scientists call the "main sequence."
The Interior of the Sun
The sun looks like a featureless yellow orb from Earth, but it has discrete internal layers. The central core, which is the only place that nuclear fusion happens, extends to a radius of 138,000 kilometers (86,000 miles). Beyond that, the radiative zone extends nearly three times as far, and the convective zone reaches to the photosphere. At a radius of 695,000 kilometers (432,000 miles) from the center of the core, the photosphere is the deepest layer that astronomers can observe directly, and is the closest the sun has to a surface.
Radiation and Convection
The temperature at the sun's core is around 15 million degrees Celsius (28 million degrees Fahrenheit), which is almost 3,000 time higher than at the surface. The core is 10 times as dense as gold or lead, and the pressure is 340 billion times the atmospheric pressure on Earth's surface. The core and radiative zones are so dense that photons produced by reactions in the core take a million years to reach the convective layer. At the beginning of that semi-opaque layer, temperatures have cooled enough to allow heavier elements, such as carbon, nitrogen, oxygen and iron to retain their electrons. The heavier elements trap light and heat, and the layer ultimately "boils," transferring energy to the surface by convection.
Fusion Reactions at the Core
Fusion of hydrogen to helium in the sun's core proceeds in four stages. In the first, two hydrogen nuclei -- or protons -- collide to produce deuterium -- a form of hydrogen with two protons. The reaction produces a positron, which collides with an electron to produce two photons. In the third stage, the deuterium nucleus collides with another proton to form helium-3. In the fourth stage, two helium-3 nuclei collide to produce helium-4 -- the most common form of helium -- and two free protons to continue the cycle over from the start. The net energy released during the fusion cycle is 26 million electron volts.