This mnemonic has been used commonly to aid in recalling the differential diagnosis of a cavitating lung mass (CAVITY):
C – cancer (primary bronchogenic carcinoma or pulmonary metastases)
A – autoimmune (rheumatoid lung disease and Wegener’s granulomatosis)
V – vascular (pulmonary emboli including septic emboli)
I – infection (pulmonary abscess)
T – trauma (pneumatocele)
Y – youth (bronchogenic cyst, pulmonary sequestration, congenital pulmonary airway malformations)
Read a nice case of cavitating lung mass here.