It sounds like this has been a very unpleasant experience for you! There are many different things that can cause sharp pain with deep breaths such as you are describing. Every time you breathe in and out the intercostal muscles between the ribs and the ribs themselves will move to accomodate the increase (or decrease) in the volume of the lungs. If you have strained or pulled one of the intercostal muscles or fractured/dislocated a rib, this can be extremely painful. In addition, the lining around the lungs--called the pleura--is very, very sensitive. Inflammation in this area can also be exquisitely painful, and once again, every time you take a breath the pleura will move slightly to accommodate the extra air in the lungs.
Your primary care physician
is the best resource to help you deal with this concern. He or she can take a more detailed history to find out if you have an other symptoms that might suggest an infection or inflammatory condition or if you have been doing any sorts of activities that might have led to a muscle injury
. In addition, the rest of your history can be very important here--for example older patients with osteoporosis can sometimes have rib fractures without any trauma. Your doctor
can also examine you carefully to help decide whether any further tests or imaging are needed. Hopefully this will help you understand what is causing your pain and how to treat it.