Gothmog,
Hematemesis, or vomiting blood, is usually a serious problem. But, it also depends upon how much blood there is. Rare, tiny flecks of blood are usually not a problem. But, any significant amount of blood should be taken seriously, and is usually treated as a medical emergency.
One also has to make sure it is being vomited, not coughed up. Hemoptysis comes from the lungs, rather than the GI tract.
If gross amounts of blood are present, then the person should be taken to the ER immediately (saving the emesis if possible for evaluation). This type of bleeding can be life threatening.
If there is minimal bleeding, this can usually be treated with medication, but still needs to be urgently evaluated.
Bleeding can present in several ways. Bright red blood can be from torn varices (veins) in the esophagus or an actively bleeding ulcer. "Coffee grounds" are usually from a slower bleed, where the blood has had time to be digested somewhat.
Thus, if there is significant bleeding, the patient should be taken to the ER. Minimal bleeding, the patient's physician should be contacted for advice on how to proceed.
Good luck.