Welcome to HCM.
Pain in the rib could be caused by a number of conditions. It may not be related with pregnancy
at all. The best advice that can be given is that you should consult a doctor and get a thorough examination done to find out the cause for this pain. In all likelihood, it may be simple muscular pain
which does not require much treatment except hot fomentation or external application of analgesic
cream, but it is always safer to exclude any serious condition responsible for this pain.
Wishing you and your baby all the best.