Magnesium metal with the application of heat reacts with oxygen in air to form magnesium oxide. The balanced chemical reaction is: 2Mg + O2 -> 2MgO. You can tell that the magnesium metal has reacted completely when you can no longer see small sparks. This means that it has been completely consumed and no reaction occurs anymore.