I had this EXACT same problem... It just came from over doing it and I backed off a bit and it went away... I would experience the pain in the gym and then still experience it hours later... I took a few days off, probably around 3, and then went back and did light, full body exercises just to stay in shape while I healed... if I felt it coming on, I backed off the weight or moved to a less intensive exercise.
For example, if I were doing push presses and it hurt, I would just go over and do raises or something... the only other very very important thing is make sure you breathe well... mine always came from holding my breath during the bottom portion of the lift... good luck, its frustrating but it will go away within a week of backing off