Another possibility could be a pinched nerve in the chest, along one of your ribs. This type usually occurs after a fit of
coughing or a blow to the chest. Finally, this pain could be due to a nerve being pinched, where it comes out of the spinal canal. X-rays of the spine can usually give a clue to this cause.
For the moment, you should give this pain time to spontaneously go away, and in the meantime, try to hold your chest with both hands over the site of the pain.