Thanks for choosing HealthcareMagic forum.
If the pain is in rib and not in the chest
then most likely you have had an injury
in that area which is causing you the pain.You stop sleeping on that side and get an X-ray
done to rule out any serious problem.You can take OTC
pain killers till then.
Dr. Rakhi Tayal