How do you treat a cracked rib?

Gnenrslly nothing. It depends on the severity and if there is an associated flail chest or punctured lung or hemopneumothorax which require urgent care. However in the vast majority of cases nothing is done.
Patience. A simple cracked rib will usually heal over a month or so. Pain is treated with otc meds but some require oral narcotics, muscle relaxers, and/or neurontin, (gabapentin) a medication that helps with the "hot poker" type pain that accompany rib fractures. Severe fractures and failure to heal can be treated surgically with titanium plates if significant decline inn ones quality of life occurs.