Painful Sex

Hey y'all! This is my first post, so bear with me if I do anything wrong. 
I noticed recently that sex with my boyfriend with me on top is really painful in the days leading up to my period. 
Any other day, it feels perfectly fine but when I'm about to get my period in a few days, it feels horrible and we have to switch positions right away. Every other position feels fine too, but for some reason me being on top just hurts. Does anyone have any clue why?