Among the possible causes of chest pain when breathing is pleurisy (fluid buildup in the pleural spaces), says Mayo Clinic. Another cause of chest pain while breathing is pneumonia (lung inflammation due to bcterial or viral infection).
Pleurisy is an inflammation of the pleura, which are membranes that line the inside of the lungs and the inside of the chest wall, according to MedicineNet. Often, pleurisy is the result of a preexisting condition such as tuberculosis, congestive heart failure or cancer. It can also be a complication of a pulmonary embolism, or a blood clot that has broken off from somewhere else in the body and traveled to the lung; infections can also lead to pleurisy. When fluid accumulates between the two layers of pleura, it is called a pleural effusion. When this fluid is aspirated and studied, it can tell the doctor what caused the pleurisy.
Pneumonia is an infection of the lung that can be caused by viruses or bacteria, says WebMD. Though most young and healthy people can be treated at home and recover after about three weeks, babies, old people and people with compromised immune systems may need to be hospitalized. People who have recently been ill are more at risk for getting pneumonia, as are people who have chronic conditions such as diabetes or cardiovascular disease.