What do doctors do to a patient who has a punctured lung?

Mior surgery. Most cases will resolve with chest tube or small cathetar in 2-5 days, a small percetage pts will require thoracotomy to close it.
Chest tube. The chest operates under negative pressure. So any injury that disturbs the lining around the lung, the pleura, also immediately removes that negative pressure. Positive pressure in the pleural space pushes the lung down, aka collapse lung. A chest tube, re-establishes the negative pressure. Once the lung is re-expanded, and the injury healed, the chest tube can be stepped down and then removed.