( 6 ) Magnesium compounds are used medicinally as common laxatives , antacids ( i.e. , milk of magnesia ) , and in a number of situations where stabilization of abnormal nerve excitation and blood vessel spasm is required ( i.e. , to treat eclampsia ) . Magnesium compounds are used medicinally as common laxatives , antacids ( i.e. , milk of magnesia ) , and in a number of situations where stabilization of abnormal nerve excitation and blood vessel spasm is required ( i.e. , to treat eclampsia ) .