Bleeding during sex

Emma

So I had sex earlier this month my boyfriend and it was all good and we have been together for a while, but Im supposed to get my period in 2 days. Last night before we had sex I had some light brown spotting. But when we were having sex i actually bled during it quite a bit. And now im not bleeding any red blood like I was but now I just am brown spotting again. Any thoughts why?