The Sun shines because it is able to convert energy from gravity into light. How does it do this? Imagine being at the center of the Sun. A huge amount of mass is above you, squeezing down on you from all sides. This is what happens to the hydrogen gas in the core of the Sun. It gets squeeze together so tightly that four hydrogen nuclei combine to form one helium atom. This is called nuclear fusion. In the process some of the mass of the hydrogen atoms is converted into energy in the form of light.
The same process occurs in thermonuclear (fusion) bombs. In the Sun the process occurs in a controled manner. In a bomb it happens all at once in a big chain-reaction explosion. The picture above is the fireball created by the largest thermonuclear bomb ever exploded by the United States. It was tremendously destructive producing a crater over a mile wide (6510 ft) and 250 ft deep. In the Sun's core the same amount of energy as 15 billion of these bombs is produced each second. The Sun doesn't blow to pieces because of the tremendous weight of the gas above. It just exactly balances the pressure from all the energy produced. If the fusion rate would go down so that less energy was produced in the Sun's core, then gravity would cause the Sun to start collapsing. This would in turn squeeze the hydrogen atoms closer together until the amount of fusion went up by just enough to produce the energy needed to hold it up again. If the fusion rate in the Sun's core goes up to much, then the pressure makes the Sun expand a little so that the hydrogen isn't quite so closely packed. The right balance is again reached when the weight from the mass above the core exactly balances the pressure from all the energy being produced.
Mass is converted to energy during nuclear reactions in the cores of stars. Is there anywhere in the universe where energy is converted into mass?