I had shoulder pain for years after some sports and weightlifting injuries and it was not fun at all. I even wrote a paper on treatment of the painful shoulder while I was earning my master's degree. Needless to say, I am attracted to this topic.
First things first; get an accurate diagnosis of the condition causing the pain. Pain is merely a symptom, it could be coming from somewhere else. Secondly, some injuries can only be healed with surgery. Thirdly, there are several ways to provide pain relief for the shoulder, you just need to be clear on the options you have available to you.
Rest, ice on a fresh injury (15-20 minutes applied through a thin towel or thick cloth, heat (applied for 15-20 minutes through a couple of layers of towel) on an older injury as well as changing your working and sleeping posture is cheap and easy to do. Remember to get your shoulder looked at by a licensed medical professional if pain persists.
I have been fortunate enough to have helped dozens (or more) people get out of shoulder pain with a combination of massage therapy and corrective exercises over the last decade. In clinical research studies; trigger point therapy (a massage technique that you can apply to yourself), stretching and corrective exercises have shown to work very well together. Chiropractic care, acupuncture and even magnet therapy have also performed well in research studies.
A home based treatment program can do wonders for more minor causes of shoulder pain such as tendonitis but you will probably see faster results seeing a physical therapist, massage therapist or other licensed practitioner for help. Keep in mind that sometimes surgery is the best option depending on the severity of the injury and what level of function you are trying to get back to.
Start with a visit to your physician and possibly some consultations with a physical therapist or orthopedic surgeon, but remember some self care initiatives could go a long way!