I think that this could be due to a muscle spasm. Did you have heavy exercise lately or have you been staying out in the cold
Strenuous exercise and cold temperature are the two major culprits. Other reason could be some injury
Try keeping it warm. Do light exercise and it will go away. If i was your doctor I would recommend an X-ray just to be sure. And prescribe some light pain killer medicines
In case the pain doesnt go away in a day or so or it increases in intensity then i recommend you get an X-ray done.
I hope that answers your query