Do you take enough magnesium? Spasms can happen anywhere in the body from deficienecy. Read up on it.
Try a heating pad, if it works, then it's simply a muscle spasm, and if magnesium isn't working, add calcium citrate and possasium suppliments too. Read up, we are all deficient in these things as a matter of course in the American diet. Really, read up!
It could be gall bladder, do you get the pain after eating some foods trigger an attack, low fat food is the way to go, no eating in the evening ,last meal early there are foods you can eat and foods to avoid that will set it off,, you really should see a doctor .