this could be pluerisy, you'll need to see a doctor for treatment, or just a trapped nerve, see your doc
I have read the following information on the link provided. It is relevent and should be helpful for you. If you have any further questions you can post back. Thank you for sharing your medical concern. Take care.
http://www.medhelp.org/posts/Respiratory-Disorders/Ribcage-pain--diaphragm-pain-with-deep-breathing-upon-waking/show/283883