There are various causes to it.
It may be that there is something wrong with the shoulder itself (sprain
/strain) or the pain may be a referred one (coming from the neck or the forearm). The worst case scenario is heart
ache radiating to the shoulder. That requires immediate attention. To better sort this out, we will need more detailed information about your pain.