Barium sulfate is a chemical compound composed of barium and sulfate ions . In the laboratory barium sulfate is generated by combining solutions of barium ions and sulfate salts . Because barium sulfate is the least toxic salt of barium due to its insolubility , wastes containing barium salts are sometimes treated with sodium sulfate to immobilize ( detoxify ) the barium .