Welcome to Health Care Magic
You should be seen by your doctor.
There could be several reasons - Irritation of the pleura
(inside the chest and apposed to the ribs) by inflammation / irritation of the nerve
- ( from the spine it runs along the lower border of upper rib to the upper border of lower rib) / muscles (intercostal, and other chest wall muscles) / Heart ...
Only an examination and basic investigations can give a clue...
Wishing speedy recovery