The shoulder is an amazing joint. It is the most flexible in the body, and can move through all ranges of motion in big, wide circles. Try it. Pretty cool, huh? The unfortunate part is what is gained in flexibility, is lost in stability. That means that the giant arm circle you just made might have hurt a little bit.
All those stretchy muscles that surround the shoulder joint, aren't very good at making things not move. It is this 'not movement' that allows the joints of the body to not hurt. If they wobble around all day, and wobble into compromised positions, pain is the result. Unstable equals not good:
So what to do? Make those shoulders stable! Often times the muscles on the front of the shoulder (pecs, front delts) get tight. This is because we have eyeballs on the front of our heads, and it tends to pull us in that direction for the entirety of our 80+ years of existence. Subsequently, the muscles on the back of the shoulder (rear delts, rhomboids, lower traps) become weak, and can't provide that stability that we oh-so-desperately need.
Here is a list of 3 great exercises for those muscles of the oft forgotten back of the shoulder. The main focal point in all three is to put the shoulder in a solid packed position. To find out why this position is important, check this out. Even if you do not have any shoulder pain, these exercises make a great tonic to help prevent it in the future. An ounce of prevention is worth a pound of cure. So do this stuff before you train, and don't feel like crap.