The present invention provides pyridine and pyrazine derivatives which restore or enhance the function of mutant and/or wild type CFTR to treat cystic fibrosis, primary ciliary dyskinesia, chronic bronchitis, chronic obstructive pulmonary disease, asthma, respiratory tract infections, lung carcinoma, xerostomia and keratoconjunctivitis sicca, or constipation (IBS, IBD, opioid induced). Pharmaceutical compositions comprising such derivatives are also encompassed.本發明提供吡啶及吡嗪衍生物,其恢復或增強突變型及/或野生型CFTR之功能以治療以下疾病:囊性纖維化、原發性纖毛運動障礙、慢性支氣管炎、慢性阻塞性肺病、哮喘、呼吸道感染、肺癌、口乾症及乾性角膜結膜炎或便秘(IBS、IBD、類鴉片誘發之便秘)。本發明亦涵蓋包含該等衍生物之醫藥組合物。