It’s the oxidation of a material in an endothermic (energy releasing) reaction. The flame you see is often due to the burning material or smoke getting so hot that it glows. There’s also another effect that you see when gas burns blue, which is caused by the release of light waves when the electrons in the atoms change energy levels.
Comments