Stars are massive, glowing spheres of hot gases, mainly hydrogen and helium, that produce their own light and heat through nuclear reactions in their cores. They are born inside large clouds of gas and dust called nebulae. Over millions of years, gravity pulls the material together to form a star. The Sun is the nearest star to Earth and is the main source of energy for life on our planet. Stars vary in size, color, temperature, and brightness. Some stars are small and cool, while others are extremely large and hot. Stars play a major role in the formation of planets and solar systems and are the building blocks of galaxies.