Just don't do the excercises that make it hurt for a couple of weeks.
You need to start warming your shoulders up before every workout. Every time I work my upper body I warm-up my shoulders.
Stand like you are posing to flex your bi's, arms out and forarms up towards the ceiling. Use light weight like 5-15 pounds and rotate your shoulder and hand down. Do 1 set of 20.
Then hold same weight with your elbows to your sides and forearms parallel to the floor and swing the weights away from your body keeping your elbows close to your sides. Do 1 set of 20.
Ever since I have been doing this my shoulder pain has gone away.