The mass of the star determines what happens after the main sequence phase. Stars similar in mass to the Sun burn hydrogen into helium in their centers during the main-sequence phase, but eventually there is not enough hydrogen left in the center to provide the necessary radiation pressure to balance gravity. The center of the star thus contracts until it is hot enough for helium to be converted into carbon. The hydrogen in a shell continues to burn into helium, but the outer layers of the star have to expand in order to conserve energy. This makes the star appear brighter and cooler, and it becomes a red giant. During the red giant phase, a star often loses a lot of its outer layers which are blown away by the radiation coming from below. Eventually, in the more massive stars of the group, the carbon may burn to even heavier elements, but eventually the energy generation will fizzle out and the star will collapse to a white dwarf. Astronomers think that white dwarfs ultimately cool to become black dwarfs.