A barium swallow X-ray, also known as an esophagram, is a diagnostic imaging procedure used to visualize the upper gastrointestinal (GI) tract, including the esophagus, stomach, and the first part of the small intestine. During the procedure, the patient ingests a liquid containing barium sulfate, a contrast material that coats the lining of the GI tract, making it visible on X-ray images.