Transcranial magnetic stimulation (TMS) is one of the nonpharmacological methods to affect the central nervous system. This approach allows a noninvasive stimulation of the cerebral cortex. The method is based on the ability of magnetic fields to penetrate the bone and muscle structures. The induced magnetic field depolarizes the neuronal membrane, and the generated action potential propagates through the conducting pathways. In the review, the biophysical effects of TMS, as well as its neural, immune, mediator and macro effects are analyzed. The main contraindications to TMS and its side effects are considered. Nonpharmacological treatment of tension headache (TH) and migraine is a promising direction, since the incidence of these types of primary headaches reaches 40-65 and 11-22%, respectively. In the article the current state of study of various modes and durations of TMS procedure, and the site of exposure in TH and migraine are considered. In recent years there is noted an increase in the number of evidence-based randomized, placebo-controlled studies on the effectiveness of TMS in migraine therapy. Much attention is given to evaluation of the effect of TMS in migraine. There is much evidence of the positive effect of this procedure. However, the amount of examined volunteers does not provide the highest level of evidence. Experiments on animals and use of functional neurovisualization techniques contribute to understanding of the mechanisms of TMS effect. Active participation of physiologists, neurophysiologists and biophysicists in these research works will permit evaluation of the effectiveness of TMS in nonpharmacological treatment of patients with pain syndrome. This approach will improve the working capacity and quality of life in TH and migraine.