Barium sulfate is a contrast agent. Barium sulfate works by coating the inside of your esophagus, stomach, or intestines which allows them to be seen more clearly on a CT scan or other radiologic ( x-ray) examination. Barium sulfate is used to help diagnose certain disorders of the esophagus, stomach, or intestines.