Pain in vigina

Dont know why i have pain when.he finishes inside me i have paain it feels like im having hsg(dye test) for a while why does this happen??