Sodium is more reactive than magnesium as the amount of energy required to remove an electron from sodium is lower than to remove two electrons from magnesium
Period 3 elements react with oxygen to form oxides, except sulfur which can form sulfur dioxide (oxidation number +4) or sulfur trioxide (oxidation number +6)