A barium swallow is a diagnostic test that uses x-rays and a thick and chalky liquid that you swallow. This liquid helps health care providers view your esophagus.