The present invention relates to pyrazinecompounds useful as inhibitors of ATR protein kinase.The invention also relates to pharmaceutically acceptablecompositions comprising the compounds of this invention;methods of treating of various diseases, disorders, andconditions using the compounds of this invention;pro-cesses for preparing the compounds of this invention;in-termediates for the preparation of the compounds of thisinvention; and methods of using the compounds in in vitroapplications, such as the study of kinases in biological andpathological phenomena; the study of intracellular signaltransduction pathways mediated by such kinases; and thecomparative evaluation of new kinase inhibitors. Thecom-pounds of this invention have formula (I):wherein thevariables are as defined herein.