Coughing blood can be a worrying symptom that may sometimes develop due to lung infections. Conditions such as pneumonia, bronchitis, or tuberculosis can irritate and damage airways, leading to small amounts of blood appearing in mucus. In some cases, the symptom may be mild, while severe infections may require urgent medical attention.