It's called a cramp. I used to have them all the time until I realized I wasn't drinking enough water (during AND after the ride), and even more important for me, not getting enough potassium.
It must not be water because I carry a gallon in my backpack in two two liter plastic bottles and its usually gone when i get home(hot summer days only,never ride in winter)