During an ERCP, the gastroenterologist uses an endoscope, a long, thin, flexible tube with a light and camera at the end, through the esophagus, the stomach, and the first part of the small intestine, called the duodenum. Once the endoscope reaches the papilla, which is the opening of the common bile duct, the physician injects dye through these ducts, enabling x-rays to be taken. A physician may recommend an ERCP if the patient is experiencing abdominal pain or develops jaundice.