Thermonuclear fusion in stars with masses between ~0.8 and 8 solar masses, similar to our Sun, produces the outward radiation pressure to counterbalance gravitational forces for approximately ten billion years. When all the core hydrogen nuclei have been converted to helium nuclei and fusion stops, gravity takes over and the core begins to collapse. The layers outside the core collapse too - the layers closer to the center collapse more quickly than the ones near the stellar surface. As the layers collapse, the gas compresses and heats up. The core temperature becomes high enough for helium nuclei to fuse into carbon and oxygen nuclei, with hydrogen to helium fusion continuing in a thin shell surrounding the core. The outer layers expand to an enormous size and the star is now called a red giant. The star brightens by a factor of ~1,000 to 10,000, and the surface temperature of the extended envelope drops to about 3,000K - 4,000K, giving the star its reddish appearance. A strong wind begins to blow from the star's surface, carrying away most of the hydrogen envelope surrounding the star's central core. During the final shedding of its envelope, when the mass loss is greatest, the star pulsates - the surface layers expand and then contract in repeating cycles - with periods from several months to more than a year.
During this pulsating stage the star is called a Mira variable star. The pulsations of Mira variable stars result in a change in the magnitude, or brightness, of the star. A plot of the change in brightness over time is call a light curve. During this stage, as mid-sized stars evolve to the giant branch, they move through an area referred to as the Mira instability strip – as shown on the H-R diagram to the right.
Eventually, the material ejected by the star forms an envelope of gas called a planetary nebula which expands into the surrounding interstellar medium at ~17-35 km/hr. The core of the star left in the center of the planetary nebula is called a white dwarf. The planetary nebula is very tenuous, and becomes so thin that after ~50,000 years it is no longer visible - therefore all planetary nebulas are very young. The white dwarf can not create internal pressure and its complete collapse is prevented by quantum mechanics. Two electrons with the same "spin" are not allowed to occupy the same energy level. Since there are only two ways an electron can spin, only two electrons can occupy any single energy level; this is known as the Pauli Exclusion Principle. In a normal gas, this is not a problem; there are not enough electrons floating around to completely fill up all the energy levels. In a white dwarf, all of the electrons are forced close together, and all the energy levels in its atoms are filled up with electrons. Since all the energy levels are filled, and it is impossible to put more than two electrons in each level, the white dwarf is now composed of “degenerate” matter. Because a white dwarf is degenerate, gravity cannot compress it any more because quantum mechanics tells us there is no more available space. The complete collapse of the white dwarf is prevented because it is held in equilibrium with gravity by electron degeneracy pressure. The white dwarf is extremely dense, ~200,000 times more dense than the Earth. The mass limit for a white dwarf to remain in equilibrium between gravity and electron degeneracy pressure is 1.4 solar masses - the Chandrasekhar limit. Over hundreds of billions to a trillion years the white dwarf will radiate its remaining energy away and become a black dwarf - a cold, dark mass of electron degenerate matter.