This pilot phase I trial studies the side effects and best dose of azacitidine in treating patients with lung cancer that is stage IV or has returned after previous treatments (recurrent). Azacitidine is a drug used in chemotherapy that may stop tumor cells from growing or spreading by activating genes that help prevent cancer growth, called tumor suppressor genes. As people age, these genes are silenced by a chemical reaction that occurs naturally in the body, or by exposure to environmental factors such as smoking. Azacitidine may help reverse this process and restore the function of the tumor suppressor genes. Delivering azacitidine directly into the lungs by inhalation may work better in treating lung cancer.