General Astronomy/The Life of High Mass Stars
A red giant is a terminal stage for most stars. When the star starts to run out of available nuclear fuel, its core can no longer completely oppose the inward pull of gravity and shrinks. However, the shrinkage adds energy to the core, which results in a temperature rise. Meanwhile the increased temperature of the surface of the core produces such photon pressure that it pushes the outer layers of gas of the star outward and into a large gaseous atmosphere. The outer layers expand and cool and the star's color shifts toward red. The star has now become a red giant. A red giant star has a core that has reached a temperature of 100 million Kelvins, but whose outer layers are much cooler. Red giants are truly enormous. One with the mass of our Sun may expand outward past the orbit of the Earth.
Red giants live perhaps a 100 million years or so, by which time its core again begins to run out of available nuclear fuel. This is followed by a new core collapse. What happens now is dependent on the mass of the core. If the core is less than 1.44 times the mass of the Sun, the collapse crushes the core further into a white dwarf, and since the white dwarf cannot contract any further due to quantum mechanical reasons, outer layers of the star that are falling onto it rebound and are blown off into space to form a large and often beautiful planetary nebula.
However, if the star is significantly more massive than our Sun, and its core is more than 1.44 times the mass of the Sun, the final collapse is great enough to crush even the Earth-sized white dwarf, pushing electrons into protons to form neutrons and so liberate vast amounts of space. Thus the core crushes down to about the size of a city and becomes an almost unimaginably compact and dense object known as a neutron star.
A pulsar is a rapidly spinning neutron star. Other stars spinning this fast would explode, but the pulsar does not because its high gravitational attraction holds it together. Pulsars have a powerful electric field that throws off electrons. These stars get their name from the signal pulses that result from their rotation.
If the original star was much more massive than the Sun and its core more than 3 times the Sun's mass, then the force of gravity crushing it at this stage is so great that not even the neutrons can withstand it, and they too are crushed to become perhaps Nature's strangest creation, a black hole.