When a sun dies after all the hydrogen in the inner core has been burnt out it turns into a red giant.
To explain this phenomenon I will go back to the last hours of the sun before it becomes a red giant.
The sun gets its energy from causing hydrogen atoms to collide using its immense heat. The hydrogen atoms vibrate so violently that the normal repelling that you get between atoms fails and they collide creating a great amount of energy.
So in the last few hours the sun is happily fusing the last of the hydrogen atoms in its inner shell but when it runs out it moves onto the outer shell and begins fusing hydrogen atoms in the outer shell. However, in the inner shell the helium atoms lose there power source and as a result they expand. This is what causes the great size of the red giant. As this happens the gravity acting on the hydrogen atoms in the outer shell increases causing the fusing to act faster creating more light energy. This is what gives the red giant its red luminosity.
Our sun is estimated to burn out in around 5 billion years time by which the human race is likely to have either died out or evolved beyond recognition. When the sun does expand it will almost defiantly engulf Venus and Mercury but the earth may ride the shock waves given out by the sun to safety, however, this is unlikely. This phenomenon is called tidal acceleration.