The sun generates energy through nuclear fusion reactions at its core, where temperatures reach 15 million degrees Celsius. This energy is released at the photosphere over thousands of years and seen as light. Sunspots occur due to magnetic fields. The sun is 109 times Earth's diameter with a mass 745 times all planets combined. It has burned for 4.6 billion years and will continue for a similar time, powered by nuclear fusion in its core.