A 65-year-old man is evaluated in the emergency department for polyuria, polydipsia, and nocturia. Medical history is notable for diabetes mellitus, for which he takes metformin. He has a 45-pack-year history of smoking and does not drink alcohol.

On physical examination, the patient is alert and oriented. Blood pressure is 110/70 mm Hg supine and 100/65 mm Hg standing, pulse rate is 88/min supine and 95/min standing, and respiration rate is 20/min. BMI is 20. Occasional expiratory wheezing is noted in the right posterior lung field.

Laboratory studies:

Blood urea nitrogen

30 mg/dL (10.7 mmol/L)

Total cholesterol

250 mg/dL (6.48 mmol/L)

Electrolytes:

Sodium

130 mEq/L (130 mmol/L)

Potassium

4.5 mEq/L (4.5 mmol/L)

Chloride

92 mEq/L (92 mmol/L)

Bicarbonate

24 mEq/L (24 mmol/L)

Glucose

800 mg/dL (44.4 mmol/L)

Plasma osmolality

319 mOsm/kg H2O

Chest radiograph shows a 2-cm cavitary mass in the right upper lobe.

Which of the following conditions is the most likely cause of this patient's hyponatremia?