Capsaicin

Capsaicin is a chemical substance. It is responsible for the sense of "spiciness" or "hotness" found in chili peppers. In mammals, it causes a sensation of "burning" of the tissues it comes in contact with. Capsaicin, and other similar substances called capsaicinoids are produced by chili peppers and other plants, probably as a protection against being eaten. Pure capsaicin is a hydrophobic, colorless, odorless, crystalline to waxy compound.
Capsaicinoids are added to food to make it have a "hot" taste, but it can also be used as an analgesic, a painkiller. Such painkillers are often directly used on the skin. The "burning" of the capsaicin will mask the real pain. Capsaicin is also the main agent in pepper spray. 
Capsaicin is not soluble in water; it binds to oil and fat. Soap can be used to wash it off. If something too hot has been eaten, milk or yoghurt can be used.