A compound of Formula I and pharmaceutically acceptable salts and solvates thereof, wherein R1, R2, R3, Ra, A, B, D and E are all as defined herein. The compounds modulate the activity of CFTR and are useful in the treatment of inflammatory or obstructive airways diseases or mucosal hydration, including, for example cystic fibrosis. Pharmaceutical compositions that contain the compounds and processes for preparing the compounds are also described.