The lifecycle of high mass stars diverges from that of low mass stars after the stage of carbon fusion. In low mass stars, once helium fusion has occurred, the core will never get hot or dense enough to fuse any additional elements, so the star begins to die. However, in high mass stars, the temperature and pressure in the core can reach high enough values that carbon fusion can begin, and then oxygen fusion can begin, and then even heavier elements—like neon, magnesium, and silicon—can undergo fusion, continuing to power the star.
The evolutionary track of a high mass star on the HR diagram is also different from that of low mass stars. An O star on the Main Sequence will cool and expand after it runs out of hydrogen in its core, but it will move almost horizontally towards the red supergiant region of the HR diagram as it goes from helium fusion to carbon fusion to oxygen fusion. It will not experience a helium flash. Although high mass stars can continue to fuse heavier and heavier elements, each fuel runs out more quickly than the previous one. So, it may fuse hydrogen on the Main Sequence for 10 million years, but it will only fuse helium for 1 million years, and it can only maintain carbon fusion for approximately 1,000 years. At some point, the fusion reactions will create iron in the core of the star, and when this occurs, the star has only minutes to live.
Just as in low mass stars where you find a carbon/oxygen core surround by a helium-fusing shell surrounded by a hydrogen-fusing shell, we expect the core of massive stars to build up in the same way, but to include many more layers, as seen in the cartoon below.
The reason that fusion of light elements produces energy to support a star is because of the “mass defect” we discussed when we studied the proton-proton chain. The product of hydrogen fusion (one helium nucleus) has less mass than the four hydrogen nuclei that created it. The extra mass has been converted into energy. Each fusion reaction of light elements in the core of a high mass star always has a mass defect. That is, the product of the reaction has less mass than the reactants. However, when you fuse iron, the product of iron fusion has more mass than the reactants. Therefore, iron fusion does not create energy; instead, iron fusion requires the input of energy.
When iron builds up in the core of a high mass star, there are catastrophic consequences. The process of fusing iron requires the star's core to use energy, which causes the core to cool. This causes the pressure to go down, which speeds up the gravitational collapse of the core. This causes a chain reaction: core collapses, iron fusion rate increases, pressure decreases, core collapses faster, iron fusion rate increases, pressure decreases, core collapses faster, iron fusion rate increases, etc., which causes the star's core to collapse in on itself instantaneously. After the core collapses, it rebounds. A large quantity of neutrinos get created in reactions in the core, and the rebounding core and the newly created neutrinos go flying outward, expelling the outer layers of the star in a gigantic explosion called a supernova (to be precise, a type II or core collapse supernova).
For a brief period of time, the amount of light generated by one star undergoing a supernova explosion is greater than the luminosity of 1 billion stars like the Sun. These explosions are so bright that they are visible at immense distances. If a nearby star were to undergo a supernova explosion, it would be so bright it would be visible during the daytime. In modern history, no supernova has gone off close enough to us to be visible during the daytime. However, both Tycho Brahe and Johannes Kepler observed naked-eye supernovae during their lifetimes. In 1987, a supernova went off about 50,000 parsecs away from us. Below is a ground-based telescope image of the supernova about 2 weeks after the explosion. Note how bright the exploding star (lower right corner) is compared to all of the rest of the objects in the image.
In the Hubble Space Telescope image below, we see the remnant of supernova 1987a, which appears as rings of glowing light.
This supernova remnant has been studied in incredible detail, and astronomers have watched the remnant change since it was first discovered in 1987. Hubblesite provides a mosaic of images of its changing appearance.
Our understanding of the fusion reactions in the cores of stars and of supernova explosions has taught us that, as Carl Sagan is quoted as saying, "We are all star-stuff, contemplating the stars.” What he means is that if you consider the chemical elements that make up the human body—including carbon, oxygen, nitrogen, and all of the elements heavier than helium—these basic building blocks of life were all created by stars!
The elements that are lighter than iron are created by fusion reactions inside of massive stars. After the core collapse, when the shockwave is moving outwards through the outer layers of the exploding star, very high temperatures are reached. These temperatures are high enough that elements heavier than iron are produced during the supernova. We have observed the signatures of these heavier, radioactive elements in the spectra of supernovae.
Not only do supernovae serve as the mechanism for the creation of these heavy elements, they also serve as the mechanism for their dispersal. Our Sun is a low mass star, so it will only ever create carbon and oxygen within its core. It will never achieve the conditions necessary to create iron. However, when we take a spectrum of the Sun, we see spectral lines from nitrogen, sodium, magnesium, iron, silicon, and even rare elements such as europium and vanadium. These elements observed in our Sun (and in many other stars) were created in ancient supernovae explosions. The elements got dispersed by the supernova explosion and became mixed in with the gas in molecular clouds. Thus, when the next generation of stars formed, the gas in the molecular cloud already contained some heavy elements. Since the Earth (and all of us!) are made of heavy elements, life as we know it would not be possible without the occurrence of supernovae prior to the formation of our Sun.
To coincide with a press release related to observations of a supernova, the Chandra X-ray Observatory team put out an animation of a core-collapse supernova (it's #9 on this page), including the dispersal of gas rich in heavy elements into the ISM after the explosion ends.