An X-ray is a common imaging test that can help diagnose, monitor and treat many medical conditions. While the most common use of X-ray imaging is to diagnose issues of the skeletal system, different types of X-rays are used for different purposes. For example, the doctor may order a mammogram to examine the patient’s breasts or they may order an X-ray with a barium enema to get a closer look at the gastrointestinal tract.