I have had this type of pain with many of the symptoms described in the above posts for years. I'm male and have pectus excavatum (an abnormal depression in the chest cavity causing the lower ribcage to protrude). At it's worst, the pain in my chest felt like I had just run a mile, even though I wasn't physically exhausted. Deep breaths caused the pain to manifest, as well as bending my torso forward or twisting my torso(especially to the right for some reason). The pain often occured while at rest. Arching my back, especially while breathing caused a series of pops from my sternum (just like knuckle cracking). The focal point of my pain was a the junction between my third rib on the right side, and my sternum, which was (and still is) slightly more pronounced than the rest of my ribs (running my fingers down my chest I can feel it more so than the other ribs). It felt like this point was trying to push together with the point of my right shoulder blade, and was extremely uncomfortable. I had no memory of trauma or injury, but assumed perhaps I had hurt myself in karate or tennis; or that the pain was being caused by my pectus excavatum.
I saw chiros, doctors, shoulder specialists, physios, and had all kinds of tests and x-rays with no definite explanation for my pain. I was advised however to really strech my chest muscles, and doing so caused my pain to lessen. I have now greatly increased my flexibility, and my pain occurs very rarely, and I'm confident that it will eventually go away. I'm now at a comfortable level. I've also noticed that some red lines caused by broken blood vessels in the centre of my chest have gone away.
I would advise everyone who suffers from chest pain to A. stretch, and B. see a physician to ensure that it's just tight muscles, and nothing else.
A good stretch for chest muscles is to go to a corner of a wall, place the arm nearest the wall at a right angle and take a step forward. Avoid arching your back. Gently taking a deep breath can increase the stretch if these muscles are very tight as they were in my case. And when you feel you are ready to increase the depth of the stretch, turn the step forward into a lunge. Listen to your body, determine your own limits, and do stop immediately if the pain is so intense it is preventing you from doing the exercise; contact a physician.