Substances such as blood trigger the Cough reflex, so if for any reason blood accumulates in the airways, it will be ejected this way.
If you have a look at chest anatomy, you can see how this could be caused (look at Trachea down to the lungs, aorta and the carotid arteries above the heart). A shot through the chest can peforate many large blood vessels, along with the airways, and cause leakage inside.
I would consider it quite hard to hit the aiways like that though, the bullet would have to enter the chest quite near the centre as the cough reflex is not triggered by substances in the lung itself, only in the airways. There may be other ways of blood getting into the airways, but I would assume that a scene with a shot near the breast and then blood coughing would be unrealistic.
Image source: Micheau, A (2010) ANATOMY OF THE MEDIASTINUM: ILLUSTRATIONS AND CROSS-SECTIONS. From: http://www.imaios.com/en/e-Anatomy/Thorax-Abdomen-Pelvis/Mediastinum-Illustrations