"Conditions of the mouth such as gum disease and tooth extraction may cause spitting blood. Spitting blood that comes up with a cough is commonly associated with lung cancer, bronchitis, and pneumonia. These may cause spitting up of bright red blood, rust-colored mucus, or mucus that contain streaks of blood."
I dunno if that is what is happening to you so you should see a doctor