This is a very common question/complaint that I hear as a physical therapist. There are multiple reasons your shoulder may hurt when reaching overhead, but most often it boils down to something we call impingement.
Impingement is a condition whereby the tendons, which attach the muscles that lift our shoulder, get pinched on the underside of the acromion, which is that arch of bone at the top of the shoulder. The squeezing of the tendons between the bones activates pain receptors that tell you reaching overhead is painful. This generally is not a single-episode event, and typically occurs as the result of weakness, altered motor patterns, or repeated pinching/microtrauma.
Shoulder impingement can present and result in varying degrees of disability. In the early stages, pain tends to predominate over loss of motion as the tendon/muscle complex still functions well. However, if left untreated, restricted range of motion of the shoulder can develop. As restricted motion happens, altered muscle activation patterns can lead to further risk of damage to the tendon/muscle complex. This is the time to seek conservative care such as physical therapy. Physical therapy can help to address the potential reasons/result of the impingement by addressing restricted mobility, strength deficits, or postural related factors associated with the condition.
Ultimately, the tendon/muscle complex can become compromised from the prolonged impingement syndrome resulting in tearing of the muscle/tendon complex if left untreated. Once that happens, conservative treatment options become more limited. It is possible to rehabilitate a partially torn rotator cuff, and some research indicates physical therapy for partial tears results in equal or better results than surgery. In the event of a full rotator cuff tear, consulting with your orthopedic surgeon will be necessary to determine whether surgical intervention is possible or if physical therapy would be the best option.
As with most orthopedic issues, earlier treatment is always best. Most individuals have the belief that they can overcome any issue, and in many cases that may be true. However, if you do not recover on your own within a few weeks, you risk more severe consequences and often will delay your response to treatment once you finally seek it. Advice from a physical therapist….do not wait to seek treatment.