Welcome to Just Answer and thanks for your question. Sometimes coughing can cause inflammation of the cartilage connecting the ribs to the sternum. It makes further coughing, sideways movement, etc. very uncomfortable. Treatment is anti-inflammatory medication like ibuprofen (Advil, Motrin) or naproxen (Aleve) and rest. Hugging a pillow or a large stuffed animal tightly to your chest when you cough can help some with the pain. If the coughing is bad, you may need a cough medication with codeine to prevent some of the coughing.