The section of my NSCA textbook about shoulder impingement was a revelation for me. My shoulder joints aren't very flexible, and for years I've been frustrated by pinching pains when doing overhead dumbbell presses.
Disclaimer: This article and my coaching are not intended to fix shoulder dysfunction/injury or eliminate pain or disease. You will need to see a medical professional for those solutions.
Most people have poor posture with rounded shoulders (me). One cause is relatively weaker back muscles and tighter chest muscles, keeping the shoulders shifted forward. That muscle imbalance also means the shoulder joint is less stable and allows the ball of the humerus to shift upward in the shoulder socket during overhead movement (such as serving a pitch), causing it to pinch tissues against the acromion (the part of the shoulder blade extending to the collarbone).
Pushing through the shoulder pain in a workout can cause inflammation and swelling of the rotator cuff, which narrows the shoulder joint space and kicks off a vicious cycle. I know this from experience.
The most practical solution to shoulder impingement is "pre-hab" of the rotator cuff, strengthening it so it can act as an antagonist to stronger deltoid and pectoral muscles. This keeps the humerus more secure in the scapula.
Of course, no one told me this when I started resistance training. And while there's lots of gym equipment focused on overhead lifting, there's less for isolating a rotator cuff. None of the exercises below will be common (or impressive) to see in a public gym setting. But they help give your shoulder the support it needs in order for you to get stronger overall.
Instead of accepting pain during overhead movements or limited shoulder range of motion, including simple rotator cuff strengthening from the outset of training will improve posture and shoulder stability. It's exciting to discover the further possibilities that unlocks.
If your level of shoulder pain precludes these movements even without any added resistance, you should see your physician for a physical exam.