Many different shoulder problems can cause pain at night, but the most common are tendonitis and bursitis. These conditions cause inflammation, and inflammation bothers is the worst when the shoulder is resting, not moving. You can think of inflammation like sunburn: red, hot, and painful, and worst at night.
For many people, taking two Tylenol, two Alleve, and a Benadryl about 30 minutes before bedtime can help significantly with nighttime pain. the Tylenol acts to control pain, Alleve is an anti-inflammatory, and the Benadryl provides sedation to help stay asleep. Of course, do not try this without first asking your physician if it's OK for you, but I have found this very helpful in getting patients to sleep through the night.
If nighttime shoulder pain continues beyond a few weeks, it's probably worth seeing a doctor to see if it's something more serious (like arthritis, a frozen shoulder, or a rotator cuff tear). Cortisone injections can be very helpful for nighttime pain.