stars on the main sequence produce energy by fusing hydrogen into
Main sequence After condensation of mass and ignition of a star, it generates thermal energy in the dense core region through nuclear fusion of hydrogen atoms into helium. During this stage of the star's lifetime, it is located along the main sequence at a position determined primarily by its mass, but also based upon its chemical composition and other factors. All main-sequence stars are in hydrostatic equilibrium, where outward thermal pressure from the hot core is balanced by the inward pressure of gravitational collapse from the overlying layers. The strong dependence of the rate of energy generation in the core on the temperature and pressure helps to sustain this balance. Energy generated at the core makes its way to the surface and is radiated away at the photosphere. The energy is carried by either radiation or convection, with the latter occurring in regions with steeper temperature gradients, higher opacity or both.
Red giant When the star exhausts the hydrogen fuel in its core, nuclear reactions can no longer continue and so the core begins to contract due to its own gravity. This brings additional hydrogen into a zone where the temperature and pressure are adequate to cause fusion to resume in a shell around the core. The outer layers of the star then expand greatly, thus beginning the red-giant phase of the star's life. As the star expands, the energy produced in the burning shell 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 it becomes a red giant. At this time, the star is said to be ascending the red-giant branch of the Hertzsprung–Russell (H–R) diagram.[6]