An endoscope is a small, flexible tube with a light and a lens on the end used to look into the esophagus, stomach, duodenum, colon, or rectum. It can also be used to take tissue from the body for testing or to take color photographs of the inside of the body.