In Dzogchen, rainbow body is a level of realization. This may or may not be accompanied by the 'rainbow body phenomenon'. The rainbow body phenomenon has been noted for centuries, including the modern era. Other Vajrayana teachings also mention rainbow body phenomena.
The rainbow body phenomenon is a third person perspective of someone else attaining complete knowledge (rigpa). Knowledge is the absence of delusion regarding the display of the basis.
Rigpa has three wisdoms, which are kadag, lhun grub and thugs rje. Kadag deals with tregchöd. The lhun grub aspect has to do with esoteric practices, such as (but not limited to) Thödgal, that self-liberate the human body into a Sambhogakāya(rainbow body phenomenon). The symbol of Dzogchen is a Tibetan "A" wrapped in a thigle. The "A" represents kadag while the thigle represents lhun grub. The third wisdom, thugs rje (compassion), is the inseparability of the previous two wisdoms.
In Dzogchen, a fundamental point of practice is to distinguish rigpa from sems (mind).
The ultimate fruition of the thodgal practices is a body of pure light, called a rainbow body (Wylie 'ja' lus, pronounced jalü.) If the four visions of thogal are not completed before death, then at death, from the point of view of an external observer, the dying person starts to shrink until he or she disappears. Usually fingernails, toenails and hair are left behind (see e.g. Togden Urgyen Tendzin, Ayu Khandro, Changchub Dorje.) The attainment of the rainbow body is typically accompanied by the appearance of lights and rainbows.
Some exceptional practitioners such as Padmasambhava and Vimalamitra are held to have realized a higher type of rainbow body without dying. Having completed the four visions before death, the individual focuses on the lights that surround the fingers. His or her physical body self-liberates into a nonmaterial body of light (a Sambhogakāya) with the ability to exist and abide wherever and whenever as pointed by one's compassion.