Blood in the stools indicate that there is some bleeding in the intestinal tract.
If blood origins from the esophagus, stomach or duodenum the blood will be black (melena) because of the stomach acid impact. Melena can be due to swallowing blood, bleeding esophageal varices, bleeding from stomach or esophageal ulcer and bleeding from stomach or esophageal tumor.
If the blood is fresh (rectorrhagia) it means that the blood origins from the small intestines, large intestines or anal opening. Blood can origin from some intestinal tumor, bowel inflammation (colitis) or hemorrhoids.
Sometimes blood in the stools can be invisible and can be detected only with occult blood test.