Hello. Thank you for writing.
If the sex was more aggressive than usual or you were not lubricated sufficiently, this might be the cause. Or perhaps your period was not entirely finished. The bleeding, and pain under the ribs, may also be two separate issues. If you are concerned (the pain and bleeding continue or worsen) see your doctor for an examination.