Red giants are evolved from main sequence stars with masses in the range from about 0.5 solar masses to somewhere between 4 and 6 solar masses.[5] When a star initially forms from a collapsing molecular cloud in the interstellar medium, it contains primarily hydrogen and helium, with trace amounts of "metals" (elements with atomic number > 2, i. e. every element except hydrogen and helium). These elements are all equally mixed throughout the star. The star reaches the main sequence when the core reaches a temperature high enough to begin fusing hydrogen (a few million Kelvin) and establish hydrostatic equilibrium. Over its main sequence life, the star slowly converts the hydrogen in the core into helium; its main sequence life ends when nearly all the hydrogen in the core has been used. For the Sun, the main sequence lifetime is approximately 10 billion years; the lifetime is shorter for more massive stars and longer for less massive stars.[1]
When the star exhausts the hydrogen fuel in its core, nuclear reactions in the core stop, so the core begins to contract due to its gravity. This heats a shell just outside the core, where hydrogen remains, initiating fusion of hydrogen to helium in the shell. The higher temperatures lead to increasing reaction rates, producing enough energy to increase the star's luminosity by a factor of 1,000–10,000. The outer layers of the star then expand greatly, beginning the red giant phase of the star's life. Due to the expansion of the outer layers of the star, the energy produced in the core of the star is spread over a much larger surface area, resulting in a lower surface temperature and a shift in the star's visible light output towards the red – hence red giant, even though the color usually is orange. At this time, the star is said to be ascending the red giant branch of the Hertzsprung-Russell (H-R) diagram.[1] The outer layers are convective, which causes material exposed to nuclear "burning" in the star's interior (but not its core) to be brought to the star's surface for the first time in the star's history, an event called the first dredge-up.
The mechanism that ends the complete collapse of the core and the ascent up the red giant branch depends on the mass of the star. For the Sun and red giants less than 2.571 solar masses,[citation needed] the core will become dense enough that electron degeneracy pressure will prevent it from collapsing further. Once the core is degenerate, it will continue to heat until it reaches a temperature of roughly 108 K, hot enough to begin fusing helium to carbon via the triple-alpha process. Once the degenerate core reaches this temperature, the entire core will begin helium fusion nearly simultaneously in a so-called helium flash. In more massive stars, the collapsing core will reach 108 K before it is dense enough to be degenerate, so helium fusion will begin much more smoothly, with no helium flash. Once the star is fusing helium in its core, it contracts and is no longer considered a red giant.[1] The core helium fusing phase of a star's life is called the horizontal branch in metal-poor stars, so named because these stars lie on a nearly horizontal line in the H-R diagram of many star clusters. Metal-rich helium-fusing stars instead lie on the so-called red clump in the H-R diagram.[6]
In stars massive enough to ignite helium fusion, an analogous process occurs when central helium is exhausted and the star switches to fusing helium in a shell, although with the additional complication that in many cases hydrogen fusion will continue in a shell at lesser depth. This puts stars onto the asymptotic giant branch, a second red giant phase.[7][8] More massive stars continue to repeat this cycle, fusing heavier elements in successive phases, each lasting more briefly than the previous.
A solar mass star will never fuse carbon. Instead, at the end of the asymptotic giant branch phase, the star will eject its outer layers, forming a planetary nebula with the core of the star exposed, ultimately becoming a white dwarf. The ejection of the planetary nebula finally ends the red giant phase of the star's evolution.[1]
The red giant phase typically lasts only a few million years[9] and hence is very brief compared to the billions of years that stars of roughly solar mass will spend on the main sequence.