Coughing blood is a major and serious concern. I strongly encourage you to see your doctor
emergently. Depending on your medical history and the quantity you may even need to go straight to the emergency room. This is not normal.
Coughing up blood is medically known as hemoptysis. This occurs when inflammation in the airway causes the lung's blood vessels to breakdown and leak into the airways. There can be both minor and major causes of this. Minor causes include bronchitis
or other viral infections. However, there are many serious causes of this. Serious infections like aspergillous or tuberculosis can cause it. Regular pneumonia
can cause this as well. Lung cancer is an important cause as well. Inflammatory conditions like sarcoidosis are also often implicated. Clotting conditions like pulmonary embolism also can be the causative problem.
Regardless of the cause, the effect of blood in the airways is concerning. If the blood is not coughed up but goes down the airways--this can fill up the lung. People with massive hemoptysis can drown in their own blood.
There are minor causes of hemoptysis as mentioned above. Another common thing to rule out is that it is actually hemoptysis and not simply blood coming from the mouth (gums, etc).
I would strongly encourage you to see your doctor urgently.