A variety of causes can lead to the symptoms of pain in the middle of chest when coughing, such as lung infection, pneumothorax, lung cancer, etc. Different treatments can be carried out for different causes. 1. Lung infection: Lung infection mainly manifests as cough, sputum, chest pain and other symptoms, and the main treatment is to actively fight infection. If the lung infection is caused by bacterial infection, levofloxacin, azithromycin, cefixime and other drugs can be used for anti-infection treatment. If necessary, appropriate antibiotic treatment can be selected according to the drug sensitivity test. 2. Pneumothorax: Pneumothorax can be manifested as chest pain on one side, pinprick-like or knife-like, with short duration, followed by chest tightness and dyspnea, which can be accompanied by irritating cough. Thoracic puncture and aspiration or closed chest drainage can be used for treatment. 3. Lung cancer: there may be hidden pain in chest, which is related to metastasis of tumor or direct invasion of chest wall. Different treatments, such as surgery, radiotherapy, chemotherapy, targeted therapy, etc., should be adopted according to tumor stage, pathological type and gene mutation. Besides, there are other diseases that can cause the symptom of pain in the middle of chest when coughing. If the symptoms are not relieved or aggravated, it is necessary to go to the hospital as soon as possible, and the doctor will formulate an individualized diagnosis and treatment plan according to the specific condition, so as to avoid delaying the condition.