Hemoptysis is when you cough up blood from your lungs. It can be a sign of a serious medical condition. Infections, cancer, and problems in blood vessels in your lungs can cause it.