Coughing up blood, also known as hemoptysis, can be a concerning symptom that requires medical attention. As you cough, you may observe blood in your phlegm. This could be a sign of several underlying medical issues, including: 1. Infections in the respiratory system caused by bacteria or viruses, such as pneumonia or bronchitis 2. Lung cancer, especially in smokers or those with a smoking history 3. Tuberculosis (TB) 4. Pulmonary embolism, a potentially fatal blood clot in the lungs.