In general the are two emergency procedures for treating such an injury, before operating the casualty. In case of Tension Pneomothorax, which is the worst case, that involves lung collapse due to a one way valve like wound which lets air in through the wound but not out, the doctor should first apply a needle, usually an 14g venflon cannula, on the midaxillary line between ribs 2 and 3. After the initial pressure on the lungs was released, a Thoracentesis (also known as trocar procedure in some countries), should be done.
If the case is Hemothorax or non-tension pneomothora, Thoracentesis would be enough as an initial procedure, until further treatments.
For further reading about Thoracentesis.