How do they do a thorax biopsy?

Multiple options! The choice depends on many factors including the nature of lesion, location, available resources. Least invasive is fine needle aspiration (fna) biopsy- but needs good expert skilled at getting good diagnostic material with help of well trained cytopathologist for onsite adequacy evaluation and final interpretation. Other methods are core biopsy (minimally invasive) or wedge biopsy (invasive).