Background: Lophophora williamsii (commonly named peyote) is a small, spineless cactus with psychoactive alkaloids, particularly mescaline. Peyote utilizes crassulacean acid metabolism (CAM), an alternative form of photosynthesis that exists in succulents such as cacti and other desert plants. Therefore, its transcriptome can be considered an important resource for future research focused on understanding how these plants make more efficient use of water in marginal environments and also for research focused on better understanding of the overall mechanisms leading to production of plant natural products and secondary metabolites. Results: In this study, two cDNA libraries were generated from L. williamsii. These libraries, representing buttons (tops of stems) and roots were sequenced using different sequencing platforms (GS-FLX, GS-Junior and PGM, respectively). A total of 5,541,550 raw reads were generated, which were assembled into 63,704 unigenes with an average length of 564.04 bp. A total of 25,149 unigenes (62.19 %) was annotated using public databases. 681 unigenes were found to be differentially expressed when comparing the two libraries, where 400 were preferentially expressed in buttons and 281 in roots. Some of the major alkaloids, including mescaline, were identified by GC-MS and relevant metabolic pathways were reconstructed using the Kyoto encyclopedia of genes and genomes database (KEGG). Subsequently, the expression patterns of preferentially expressed genes putatively involved in mescaline production were examined and validated by qRT-PCR. Conclusions: High throughput transcriptome sequencing (RNA-seq) analysis allowed us to efficiently identify candidate genes involved in mescaline biosynthetic pathway in L. williamsii; these included tyrosine/DOPA decarboxylase, hydroxylases, and O-methyltransferases. This study sets the theoretical foundation for bioassay design directed at confirming the participation of these genes in mescaline production.