Here's the chemical reaction:
2 Mg (s) + O₂ (g) → 2 MgO (s)
This reaction is quite exothermic, meaning it releases heat and produces a bright white light. This is why magnesium is often used in fireworks and flares.
It's important to note that magnesium is highly flammable, so it should only be heated in a controlled environment.