Painful sex

My husband and I had sex I was in top at first then we switch to me on all fours but each time he went in I got a pain in my hip on my right side, is that okay? Will it go away or?????