Patients will be randomized (by sealed envelope) in blocks of 4 to receive ketamine or placebo. The randomization will be stratified according to whether the planned surgery is via VATS or open (thoracotomy) approach. The study drug will be prepared by the investigational pharmacy and provided to the attending anesthesiologist of record for the case. It will contain 0.5 mg/kg ketamine for injection by IV bolus over 5 minutes, or as an equivalent volume of 0.9% saline. It will be the responsibility of the principal investigator to ensure that study drug is administered in a timely fashion, usually by delegation to the attending anesthesiologist of record for the case. The anesthetic procedure will be standardized in that each patient will receive a total intravenous anesthetic using propofol and an intravenous opioid infusion. This anesthetic will be supplemented by an epidural and intravenous opioid boluses as needed to control pain.