It is not uncommon for cats to throw up the occasional hairball. However, if your cat were to ever vomit blood, also called hematemesis, your cat could be suffering from something that requires immediate veterinary medical attention. Hematemesis can have two very different appearances. If the blood is coming from the esophagus, stomach, or upper part of the small intestines, it may appear as bright red streaks. If the blood is coming from further down the GI tract, thought, it will appear as coffee grounds. This is due to the blood being partially digested. Regardless of where in the GI tract the blood originated from, vomiting blood can be indicative of a wide variety of medical conditions that your vet can help you diagnose and treat.
As in people, cats can develop open sores on the mucous membranes lining of their esophagus or stomach. They are commonly caused by bacteria in cats and can also cause a loss of appetite, pale gums, lethargy, dark stools, and bloody diarrhea.
If you suspect that your cat is vomiting blood due to an ulcer, get them in to see their vet as soon as your can. Your vet will then be able to create a treatment plan specific to your cat.