The currrent theory says the sun ain't going to explode. The sun will run out of hydrogen to burn, and start burning helium and lithium, and shedding its outer layers. The loss in mass will cause it to swell to a radius the size of earth's current orbit. Luckily, the loss in mass will mean the earth will orbit much further out from the sun than it does today, but the sun will then stop burning, and collapse into a dwarf star. The earth will go into deep freeze, and possible spin off into space. Not so great, but at least we won't be blown to smithereens I suppose...