perhaps you have just layed a bit awkward if pain does not go away go to gp
I would say maybe a pinched nerve I get that all the time when I sneeze I wouldn't worry if you are worried not a whole lot they will do for it I had it for years..
Which came first the pain in arm or the cough. If the cough, then you could have pulled a muscle in your shoulder region and are feeling some referred pain. If you're not allergic to it, you could try some Ibuprofen over the counter as directed to see if that helps it. That's some good stuff for any inflammation that you may have going on, just be sure to always eat something with it so you don't get ulcerations in your stomach. If that pain is not helped by the ibuprofen, you should probably see your physician to rule out some other pathology! Good luck!