"Barium swallow" is the name of a radiographic imaging procedure; simply put, the patient drinks a mixture containing a suspended barium solid (i.e. insoluble) and sequential X-rays are taken as the liquid exits the mouth and proceeds along the gullet to the stomach.
The barium coats the tissue surface, producing an interface between the tissue and the barium, which generates a very clear surface contour for the radiologist to examine. This can highlight surface abnormalities, strictures and so on.
Barium is used because it is a very heavy, dense metal (you'll notice that when you pick up the cup to drink it!) and therefore, like lead, a very good absorber of X-rays. Consequently, barium-coated surfaces appear white on X-rays pictures because very few X-rays get through in this area.