I would suggest seeing your physician to determine the cause of the pain. It could be muscle pain, inflammation of a nerve outside of your lungs or directly related to your lungs. I good physical examination should help clear up the cause and then suggest the best therapy.
Could be muscular, could be respiratory, like pleurisy for example. You need to see a doctor; an xray can look at your lungs to find out if it's a respiratory condition. A doctor will probably ask you if you've had an recent flu, cold - chest infections in case it might have developed into pneumonia but the referred pain from pneumonia in my experience(7 times) is also in the top of the shoulder on breathing. It's a case for your GP, so go and see him. All the best.