The present invention relates to pyridines or pyrazines that inhibit kinases. In particular the compounds of the invention inhibit members of the class III PTK receptor family such as FMS (CSF-IR), c-KIT, PDGFRβ, PDGFRα or FLT3 and KDR, SRC, EphA2, EphA3, EphA8, FLT1, FLT4, HCK, LCK, PTK5 (FRK), SYK, DDR1 and DDR2 and RET. The compounds of the invention are useful in the treatment of kinase associated diseases such as immunological and inflammatory diseases; hyperproliferative diseases including cancer and diseases involving neo-angiogenesis; renal and kidney diseases; bone remodeling diseases; metabolic diseases; and vascular diseases.