Costochondritis is a benign, though painful, inflammation of the chest-wall. It's estimated to account for more than a quarter of the chest-pain cases in adults. ( ref. Musculoskeletal Sports and Spine Disorders pp 171-173 )
The cause is unknown. Some instances are due to over-exertion or trauma, and bacterial infection has also been suggested.
It usually resolves in a few weeks without treatment, but can also last for several months.
Further details Wikipedia