Right before the procedure the physician may spray your throat with a numbing agent that may help prevent gagging. If in the hospital or an approved outpatient center, you may also receive pain medicine and a sedative to help you relax during the exam. A plastic mouthpiece called a bite block is placed between your teeth to prevent you from accidentally biting the endoscope. The endoscope transmits an image of the inside of the esophagus, stomach, and duodenum, so the physician can carefully examine the lining of these organs. The physician can see abnormalities, like ulcers, through the endoscope that don't show up well on x-rays.
Gastrointestinal endoscopy is quite safe.
However, as in any invasive procedure, there is always a possibility that problems can occur during and after the procedure. Physicians review the risks and anticipated benefits of the procedure with you beforehand, individualized to each person. As part of most hospital standards, you will be asked to sign an informed consent that basically outlines the general risks of gastrointestinal endoscopy. During the procedures there is a small risk of bleeding, more likely when a biopsy is taken or a growth removed. This is usually treated conservatively, but on extremely rare occasions a transfusion could be needed.