Magnesium reacts with oxygen present in air to produce magnesium oxide;
2 Mg + O₂ → 2 MgO
This reaction doesn't start on its own but requires a initiation energy called activation energy. When provided with this activation energy with the help of Bunsen burner it will start a spontaneous reaction because the further energy required for reaction is generated by itself.