Coughing up bubbly sputum is mainly caused by respiratory diseases, most commonly acute and chronic bronchitis, bronchiectasis, lung abscess and other diseases. You need to go to the hospital to do routine blood tests, you also need to take a chest X-ray or do a CT examination of the lungs, you also need to do sputum test and drug sensitivity test. According to the results of the positive treatment, need to use sensitive antibacterial drugs, also need to use cough and phlegm drugs. In addition, we also need to consider is caused by acute pulmonary edema, there are various causes of right heart failure will cause pulmonary stasis, edema, will cough up pink foamy sputum, need to be treated with cardiac diuretic drugs, but also need to actively treat the primary disease.