section_path: Formation and evolution/Post–main sequence
section_name: Post–main sequence
paragraph_text: Post–main sequence
  
  As stars of at least 0.4 M exhaust the supply of hydrogen at their core, they start to fuse hydrogen in a shell surrounding the helium core. The outer layers of the star expand and cool greatly as they transition into a red giant. In some cases, they will fuse heavier elements at the core or in shells around the core. As the stars expand, they throw part of their mass, enriched with those heavier elements, into the interstellar environment, to be recycled later as new stars. In about 5 billion years, when the Sun enters the helium burning phase, it will expand to a maximum radius of roughly 1 astronomical unit (150 million kilometres), 250 times its present size, and lose 30% of its current mass.
  
  As the hydrogen-burning shell produces more helium, the core increases in mass and temperature. In a red giant of up to 2.25 M, the mass of the helium core becomes degenerate prior to helium fusion. Finally, when the temperature increases sufficiently, core helium fusion begins explosively in what is called a helium flash, and the star rapidly shrinks in radius, increases its surface temperature, and moves to the horizontal branch of the HR diagram. For more massive stars, helium core fusion starts before the core becomes degenerate, and the star spends some time in the red clump, slowly burning helium, before the outer convective envelope collapses and the star then moves to the horizontal branch.
  
  After a star has fused the helium of its core, it begins fusing helium along a shell surrounding the hot carbon core. The star then follows an evolutionary path called the asymptotic giant branch (AGB) that parallels the other described red-giant phase, but with a higher luminosity. The more massive AGB stars may undergo a brief period of carbon fusion before the core becomes degenerate. During the AGB phase, stars undergo thermal pulses due to instabilities in the core of the star. In these thermal pulses, the luminosity of the star varies and matter is ejected from the star's atmosphere, ultimately forming a planetary nebula. As much as 50 to 70% of a star's mass can be ejected in this mass loss process. Because energy transport in an AGB star is primarily by convection, this ejected material is enriched with the fusion products dredged up from the core. Therefore, the planetary nebula is enriched with elements like carbon and oxygen. Ultimately, the planetary nebula disperses, enriching the general interstellar medium. Therefore, future generations of stars are made of the "star stuff" from past stars.