Pain in the chest and shoulders. Coughing up phlegm. Is the pain from lungs?

Hello, I have pain that is in the left hand side of my breast and it goes right through to my back to the inside of my shoulder blade. It was only hurting when i cough, but now the pain is permanently there. I thought it may have been an injury as a result of my gym routine, so i have had it for approx 4 days and was hoping it would go away. I am coughing up phlemn, and it is difficult to ascertain if the pain is in my lung.