Physics/chemistry understanding of PMOS and NMOS to form CMOS
Wikipedia doesn't do a bad job of explaining the basic process of doping a semiconductor to form a P/N type material. The Doping Semiconductor page particularly. For silicon, generally Boron is used to dope for P-type, and Phosphorus is used to create N-type.

Essentially, doping creates either extra electrons (N-type) or holes (P-type) and produces a material that has a "useful" function. Semiconductors on their own aren't of much use until you add these impurities.