Dr. Gina Sam, director of the Gastrointestinal Motility Center at Mount Sinai Hospital, says black poop can be a sign of bleeding in the upper portion of your GI tract. This sort of bleeding is black because it's had a while to chill out through your intestines on its way from your esophagus or stomach to its exit.
Of course, it may just be something simple like Pepto-Bismol, which has the unfortunate side effect of causing weird black poop (the same is true for other products that contain bismuth salicylate). Other benign causes of black poop are consuming black licorice, iron pills, or even blueberries.
Red poop is almost always alarming because for most people, red equals blood. And yes, sometimes that is the case, and the causes can vary wildly -- as Dr. Sam explains, it can be something as simple as hemorrhoids, or as serious as colon cancer. Inflammatory bowel disease, infection, and trauma can also cause red bleeding. Here again, though, there are less-serious potential causes -- copious amounts of beets and tomatoes can make your poop appear red, but your doctor can determine if your red poop is in fact blood or a byproduct of your favorite foods.