AGREED! Definitely stretch your hands before, during and after you knit!
I suggest taking a break every 15 mins for about 2 mins or so, maybe more and stretching and breathing. and you could massage your hands and arms too...that could help.
Here's a good page for self massage.
Hope this helps!
And of course, if the pain continues, please see a doctor! We don't want to be in pain while knitting!
Also, there's this GREAT stuff called BioFreeze. It works kinda like IcyHot, Bengay and TigerBalm, if you've heard of them, but it's the strongest I've ever felt. I love it and recommend it if the pain continues, or if you just plain forget to do the stretching and breaks (it happens). Also, this could be due to repetitive motion from your muscles and perhaps pinching a nerve - another hint to take frequent breaks. And also, a good body massage never hurt anyone. I'd give one for free if you lived near, but I highly doubt that!
I'm a massage therapist in training