Simply put, because it’s hot – in fact, lava can reach up to 1,250 degrees Celsius (2,282 degrees Fahrenheit). Heat excites atoms, which can boost atoms’ electrons to higher orbitals. When an excited electron returns to its normal orbital, it releases its excess energy as a light photon. Collectively, the photons produce a glow. The colour varies between atoms of different elements. And why is lava so hot? Lava is molten rock that escapes from the Earth’s inner mantle layer. Scientists trace the mantle’s heat back to the planet’s formation. The immense energy of material accreting together to form Earth heated the planet’s interior, and the outer crust has bottled it up all this time.
Answered by Tom Harris.