Here's the balanced chemical equation for the reaction:
2 Mg (s) + O₂ (g) → 2 MgO (s)
The reaction produces a bright white light and a white powdery substance, which is magnesium oxide.