Welcome to the board of Health care magic.
Dear friend it appears that you have injured your rib along with the soft tissues.
Till the injured part is inflammed, it will be painful especially during movements.
You symptoms will be alleviated with taking regular anti inflammatory and analgesic
drugs for a week or two. And such symptoms take some time to vanish.
Hope your query is answered