Barium sulfate is a chemical compound composed of barium and sulfate ions. It contains barium in the +2 oxidation state, as in all barium compounds. It does not dissolve in water. If it did, it would be very toxic. It is used in X-rays of the stomach and intestines to see whether there is a problem with them. Its chemical formula is BaSO4.