The rumen is the hallmark organ of ruminants and hosts a diverse ecosystem of microorganisms that facilitates efficient digestion of plant fibers. We analyzed 897 transcriptomes from three Cetartiodactyla lineages: ruminants, camels and cetaceans, as well as data from ruminant comparative genomics and functional assays to explore the genetic basis of rumen functional innovations. We identified genes with relatively high expression in the rumen, of which many appeared to be recruited from other tissues. These genes show functional enrichment in ketone body metabolism, regulation of microbial community, and epithelium absorption, which are the most prominent biological processes involved in rumen innovations. Several modes of genetic change underlying rumen functional innovations were uncovered, including coding mutations, genes newly evolved, and changes of regulatory elements. We validated that the key ketogenesis rate-limiting gene (HMGCS2) with five ruminant-specific mutations was under positive selection and exhibits higher synthesis activity than those of other mammals. Two newly evolved genes (LYZ1 and DEFB1) are resistant to Gram-positive bacteria and thereby may regulate microbial community equilibrium. Furthermore, we confirmed that the changes of regulatory elements accounted for the majority of rumen gene recruitment. These results greatly improve our understanding of rumen evolution and organ evo-devo in general.