The Sun was born about 4.6 billion years ago from the gravitational collapse of a vast cloud of gas and dust. Material in the center of the cloud was squeezed so tightly that it became hot enough to ignite nuclear fusion.
Today, the Sun continues to fuse hydrogen atoms to make helium in its core. It fuses about 600 million tons of hydrogen every second, yielding 596 million tons of helium. The remaining four million tons of hydrogen are converted to energy, which makes the Sun shine. Most of this energy is in the form of gamma-rays and X-rays. As the energy works its way to the surface -- a process that takes centuries -- it is absorbed by other atoms, then re-radiated at other wavelengths. When it reaches the surface, where it can escape into space, most of the energy is in the form of visible light.
The motions of the hot gas below the Sun's surface create a powerful magnetic field. The field encircles the Sun with lines of magnetic force. These lines become entangled, forming relatively cool, dark magnetic storms on the Sun's surface known as sunspots. Occasionally, the entangled lines "snap," triggering enormous explosions of energy known as solar flares. Magnetic effects also pull out big streamers of hot gas from the Sun's surface, and they heat the Sun's thin outer atmosphere to more than one million degrees.
The number of sunspots and flares peaks every 11 years, when the Sun's magnetic field flips over. It takes two "flips" to complete a full cycle.
The Sun will continue to burn its hydrogen for several billion years more. As it depletes the supply of hydrogen, its core will shrink and temperatures will climb high enough for it to burn helium instead. The Sun's surface will puff up like a balloon, growing cooler, brighter, and redder, forming a red giant.
Eventually, as the Sun burns helium to form heavier elements, it will reach a critical point where fusion cannot release enough energy to form new elements, so fusion will end.
After that, the Sun will shed its outer layers, surrounding itself with a colorful bubble of gas called a planetary nebula. As the nebula dissipates, distributing carbon, oxygen, and other elements into the galaxy, only the Sun's collapsed core will remain -- a dense ball no bigger than Earth, containing about 60 percent of the Sun's original mass. This dead remnant is called a white dwarf. Over many billions of years, the white-dwarf Sun will cool and fade from sight, leaving behind a dark cosmic ember.
What are sunspots?
Sunspots are regions on the Sun's visible surface, or "photosphere," where gases have been trapped by magnetic fields. The hotter material bubbling up from the Sun's interior cannot penetrate the strong magnetic fields (about 10,000 times stronger than Earth's), and thus are prevented from reaching the surface. These magnetic areas cool down (from about 9,800 to 6,700 degrees Fahrenheit (5,500 to 3,750 C)), so they don't glow as brightly as the rest of the photosphere. Sunspots are actually quite bright, but appear as dark spots against their much brighter surroundings.
Sunspots have complex structures, which are caused by the geometry of the magnetic fields. The darkest area in the center, the "umbra," is where the magnetic field is strongest. Around the edge of the sunspot, the field weakens, so this "penumbra" is a little brighter and shows radial streaks. Sometimes "light bridges" cross the umbra, like sparks jumping the gap in a spark plug.
The number of sunspots visible on the Sun's surface varies from maximum to minimum and back again over an average period of 11 years, called the "sunspot cycle." The most recent solar minimum occurred in December 2008. Scientists predict the next peak will occur in May 2013.