Pain during sex

Recently I have experienced such bad pain during sex that before i know it i am pushing him off of me and yelling stop it before i knew it. endometriosis runs in the family and I think i should go to the doctor but i’m scared too more than anything