I agree completely with owl.
Try laying off the guitar for a couple days. If the pain DOES stop, or is at least greatly reduced, then my best guess is that either you are overworking your RH or perhaps you have improper RH technique or even bad posture. I recently had this problem and someone here suggested adjusting my playing habits, which helped dramatically.
If the pain DOES NOT stop after a couple of days, then definately see a doctor. You might have some kind of injury that could potentially lead to permanant diminished use of that hand.
Arthritis or a crick in the ol' spine (or even elbow) are certainly other things to consider.
Best of luck!