That used to happen to me a lot! I have flat feet and i think that had something to do with it... or at least aggrivated the underlying problem. For me, the problem was that i didn't stretch out effectively. See, i used to stretch my gastrocnemius with a strait leg, which was good for standing calve raises. However, with a seated calve raise, you put a lot of slack into the gastroc mulsce [because its origin is above the knee]. This puts the emphasis onto the soleus muscle to do a lot of the work [because it's origin is below the knee and therefore is not affected by the bend in the knee].
My problem was that i never used to stretch this muscle. You may be ignoring this stetch also. What you gotta do, is do a regular calve stretch, but bend the knee instead of keeping the leg strait. This really stetches the soleus muscle. Be sure to hold the stretch for a while... and dont forget to do a regular calve stretch also.
Anyway, this helped me a lot with my pain!
-Fatty