If active bleeding is found, such as bleeding caused by an ulcer, the doctor can coagulate the bleeding blood vessels using the endoscope.