Pain during sex.

Yesterday my boyfriend and I were having sex (don't stress we had protection) and I had this really bad pain in my hips, mostly on the right side.

Any idea what it could be?