Double-stranded DNA (dsDNA) binding and cleavage by Cas9 is a hallmark of type II CRISPR-Cas bacterial adaptive immunity. All known Cas9 enzymes are thought to recognize DNA exclusively as a natural substrate, providing protection against DNA phage and plasmids. Here, we show that Cas9 enzymes from both subtypes II-A and II-C can recognize and cleave single-stranded RNA (ssRNA) by an RNA-guided mechanism that is independent of a protospacer-adjacent motif (PAM) sequence in the target RNA. RNA-guided RNA cleavage is programmable and site-specific, and we find that this activity can be exploited to reduce infection by single-stranded RNA phage in vivo. We also demonstrate that Cas9 can direct PAM-independent repression of gene expression in bacteria. These results indicate that a subset of Cas9 enzymes have the ability to act on both DNA and RNA target sequences, and suggest the potential for use in programmable RNA targeting applications.