The activation of the chemical reactions and pathways resulting in the formation of phytoalexins, low-molecular mass, lipophilic antimicrobial compounds that accumulate rapidly at sites of incompatible pathogen infection.