I had a similar experience a couple years ago. I went to a chiropractor who treated me as if I had pulled chest/upper back muscles for several months. The treatments felt good at the time but ultimately just led to more and more chiropractor appointments. Then I had a chest x-ray when I was thought to have bronchitis which is when it was realized I had a pneumothorax (aka collapsed lung) the whole time. As your condition has been ongoing for months, it seems like it might be a good idea to go to your PCP when the pain is acting up and suggest the possibility of a chest x-ray.
For temporary pain relief, I have found Salonpas patches (both regular and Hot), Johnson's back plaster, and other topical analgesics like FlexAll or IcyHot (my favorite is ActivOn Backache) can be helpful, as well as ibuprofen (when taken with food to avoid stomach problems) or aspirin & Doan's.
How are you? What are other symptoms present? Do you exercise or lift heavy objects a lot? If this is a muscle strain, you can benefit from R.I.C.E.:1) Rest and avoid the use of the muscles in the chest with lifting or exercise; 2) Ice- you can try cold compress for the pain; 3) Compression- for those with swelling and 4) elevation - whole upper part of the body may be elevated gently with pillows or a reclining chair.
However, if the pain persists, it would be best to see your doctor for proper evaluation. He may order a chest x-ray to make sure that there are no broken bones present or lung condition such as pneumonia or pneumothorax.
I hope this helps. Take care and keep us posted.