As cyclists, there is always advice floating around us on how to prevent against knee and leg pain—moving the saddle fore and aft, the 30 degree rule-of-thumb for knee flexion with the pedals at 6 and 12, and even articles I've posted regarding the hip/pelvis and foot/ankle. But what more infrequently gets addressed is shoulder and upper back pain/discomfort from riding for long periods.
As I've said throughout my years in practice, you should always have the problem evaluated by a sports physician prior to beginning any self-treatment. This ensures that you are not risking further damage to the area, and are also not reinforcing bad habits. Doing exercises with compromised muscular balance and dysfunctional joints can lead to injury, and you are likely not able to perform any exercises as they are truly intended with any level of dysfunction that is great enough to cause pain. And more so, performing them in a manner in which they are not intended will reinforce the dysfunctional movement patterns and imbalances.
That being said, if the symptoms are more of discomfort or fatigue than pain, this exercise should be very effective at helping to relieve your shoulders on longer rides.
Many times the fit is the problem, and you are putting too much pressure on your hands as you lean forward on your bike (more common with road cyclists). A professional fit is crucial if you are planning on riding a bike regularly. I always recommend that your dysfunction is evaluated prior to any fit so that you are not being fit into a biking position with compromised joint function and muscle balance. Fix the body, fit the bike.
In a lot of cases the problem is a chronic weakness in the middle and lower trapezius muscles of the back. The middle and lower traps are located between your shoulder blades. They oppose the more commonly known upper traps by bringing the shoulders down away from the ears. The upper traps are the big muscles between your neck and arm that are often tight or sore with desk work or stress—or cycling!
The key is to strengthen the middle lower traps so that the upper traps do not have such an advantage in pulling the shoulders up to the ears (it's a muscular tug-of-war). A great way to do this is to consciously pull your shoulders down toward the ground and pinch your shoulder blades together. Hold them there for counts of 15 seconds 3 times once a day. Gradually add time until you are able to keep them there comfortably for a minute each of those 3 times.
For the second exercise, get onto the floor on all fours. Keep your knees under your hips, and your hands under your shoulders. Really focus on keeping your shoulders pulled down from your ears, your shoulder blades together, and both of the blades flat against your back. This is more advanced and may require some training from a sports medicine physician or Pilates instructor to make sure that you have the correct starting position. Hold this position for 30 seconds 3 times once a day. As you progress and this becomes easier to maintain, gradually shift your weight from your left to your right hand without allowing your shoulder blades to move—keep them stable.
With these exercises, you will be able to develop middle back strength that will allow you to ride longer more comfortably, and even sit at a desk/computer longer with greater comfort.
If these exercises do not help your discomfort within 2-3 weeks, please consult a sports medicine physician to have the problem evaluated and treated. I am fond of helping my patients cheat by using kinesiology tape which allows their bodies to focus subconsciously on using specific muscles based on how the tape is applied.
Ride safe and comfortably!