For stars with less than 8 solar masses:
* Planetary nebula: After the red giant phase, the star sheds its outer layers in a powerful stellar wind, creating a colorful, expanding shell of gas and dust called a planetary nebula. The remaining core, a hot, dense white dwarf, cools slowly over billions of years.
For stars with 8 to 25 solar masses:
* Supernova: After the red giant phase, the core collapses rapidly, triggering a catastrophic explosion called a supernova. The supernova remnant consists of a rapidly expanding cloud of gas and dust, and a dense, compact neutron star.
For stars with more than 25 solar masses:
* Supernova and black hole: These massive stars also end their lives in a supernova, but the core collapses so dramatically that it forms a black hole, a region of spacetime with such strong gravity that nothing, not even light, can escape.
In summary:
* Low-mass stars: Red giants become planetary nebulae and white dwarfs.
* Intermediate-mass stars: Red giants become supernovae and neutron stars.
* High-mass stars: Red giants become supernovae and black holes.
It's important to remember that these are just the general trends. The specific evolution of a star depends on its initial mass, composition, and the environment it's in.