Coughing of blood is called hemoptysis.In 90%cases,the cause is pulmonary in origin.Various possibilities are malignancy of lungs,bronchitis,bronchiectasis,broncholithiasis,pneumonia,tuberculosis lungs,fungal infections etc.Other possibility is of cardiac pathology like AV malformation,mitral stenosis,aortic aneurysm and left ventricular failure.
Your friend should consult a chest physician as soon as possible and get x-ray and CT chest doen to confirm the cause.Treatment depends on the same.
Hope it helps.Take care and pls do keep me posted on how your friend is doing.
Your friend really needs to see a physician. Does he have health insurance ?