Pterostilbene (PTE) is a stilbene-derived phytoalexin that originates from several natural plant sources. In this study, we evaluated the activity of PTE against Candida albicans biofilms and explored the underlying mechanisms. In 2,3-bis-(2-methoxy-4-nitro-5-sulfophenyl)-2H-tetrazolium-5-carboxanilide (XTT) reduction assays, biofilm biomass measurement, confocal laser scanning microscopy, and scanning electron microscopy, we found that ≤16 μg/ml PTE had a significant effect against C. albicans biofilms in vitro, while it had no fungicidal effect on planktonic C. albicans cells, which suggested a unique antibiofilm effect of PTE. Then we found that PTE could inhibit biofilm formation and destroy the maintenance of mature biofilms. At 4 μg/ml, PTE decreased cellular surface hydrophobicity (CSH) and suppressed hyphal formation. Gene expression microarrays and real-time reverse transcription-PCR showed that exposure of C. albicans to 16 μg/ml PTE altered the expression of genes that function in morphological transition, ergosterol biosynthesis, oxidoreductase activity, and cell surface and protein unfolding processes (heat shock proteins). Filamentation-related genes, especially those regulated by the Ras/cyclic AMP (cAMP) pathway, including ECE1, ALS3, HWP1, HGC1, and RAS1 itself, were downregulated upon PTE treatment, indicating that the antibiofilm effect of PTE was related to the Ras/cAMP pathway. Then, we found that the addition of exogenous cAMP reverted the PTE-induced filamentous growth defect. Finally, with a rat central venous catheter infection model, we confirmed the in vivo activity of PTE against C. albicans biofilms. Collectively, PTE had strong activities against C. albicans biofilms both in vitro and in vivo, and these activities were associated with the Ras/cAMP pathway.