A barium enema is an X-ray exam of your rectum and colon. This test helps your doctor detect problems such as blockages, tumors, polyps, or other problems.