Welcome to JustAnswer!
Do you have cough?
Are you a smoker?
Any tests done?
Blood while spitting is called hemoptysis.
Hemoptysis can occur due to conditions like bronchitis, tumor, tuberculosis, bleeding disorder etc. Sometimes it may be due to heart disease or may have a bleeding source in the gastrointestinal tract or locally in the oral cavity.
If the symptom recurs you may have consult your physician for complete evaluation.