If it hurts, stop playing. Try to be relaxed in your approach and posture.
Warmup before you play every time. I also warmup when I wakeup in the morning.
Stretch after you play every time. I also stretch before I go to bed at night.
Warmups, Stretching, and Excercises For Musicians (Full Notes – PDF)