Yes, magnesium reacts with sodium chloride. The reaction between magnesium and sodium chloride is a classic example of a single-displacement reaction. In this type of reaction, one element replaces another element in a compound. In the case of magnesium and sodium chloride, the magnesium replaces the sodium in the sodium chloride compound. The products of the reaction are magnesium chloride and sodium metal. The chemical equation for the reaction is:
2NaCI (aq) + Mg(s) → MgCl2(aq) + 2Na(s)
In this reaction, the magnesium atoms are oxidized from a neutral state to a +2 oxidation state, while the sodium atoms are reduced from a +1 oxidation state to a neutral state. The reaction is also exothermic, meaning that it releases heat.