A 48-year-old man presents with a 2-week history of cough productive of small amounts of blood-streaked sputum. He is a 30-pack-year smoker and has lost 4 kg in 3 months. Chest X-ray shows a left upper lobe mass. What is the most appropriate next step?