To say that something is being "burned" means we are adding oxygen in the form of a combustion reaction. Generally speaking combustion reactions are exothermic, but not spontaneous.
In the case of magnesium the reaction would be:
Mg(s) + O2(g) --> MgO2(s) + energy
There are some things to notice about this reaction:
oxygen gas is a diatomic gas. That is to say that oxygen gas is one of the classes of elements that comes in nature as two atoms bound toghter.
this is a synthesis (or combination reaction) which means two or more substatnces are being combined to form a single product.
the reaction is exothermic (gives off energy) because energy is on the product side of the yield arrow.
When this reaction actually takes place, the magnesium burns with a very bright, white light which produces a great deal of heat and light energy not only in the visisble range but alson in the ultraviolet range. The bright white light is one of the main reasons why magnesium is used in emergency flairs and fire works.
A white bright light is produced and the magnesium reacts with the oxygen in the air to produce magnesium oxide.