Also possible to have popped the head of the rib out from its cartilage socket. The rib bone itself doesn't plug right into the breastbone, but instead into a big mess of cartilage and connective tissue. Most of the time that's a pretty firm connection, but sometimes the rib will pop free of its bindings. Can be pretty painful, but can also be popped back in. Can be a recurring problem called Slipped Rib Syndrome.
Much of the time though the pain after coughing hard comes from pulled muscle or sprain of muscle/connective tissue. Just like any other sprain, the best treatment is time and rest (as in no longer coughing -- or binding the area with a wrap around sheet or something, so that area of the chest doesn't flex with deep breath.)
Sharp pains with breathing -- that are only present with the deep breath or cough -- are usually from sprains, but can be from other problems. Pleurisy is an inflammation of the lining tissue around the lung, which causes pain whenever the lining surfaces rub together. It can be caused by pneumonia, viral infections of the chest, or rarely show up by itself. More concerningly, when there's a sudden onset of pain (usually without the cough) and equally sudden onset of shortness of breath, fast heart rate, and fast breathing rate may need to thinlk about bllod clot to lung. Most common in older people, after long periods with minimal leg movement, and in people with higher risk of cblood clots in general. (Brith control pills, smoking, medical disorders.) This wouldn't cause a bump on your chest wall, though.