The ability to sense infrared thermal radiation evolved independently in several different families of snakes. Essentially, it allows these animals to "see" radiant heat at wavelengths between 5 and 30 μm to a degree of accuracy such that a blind rattlesnake can target vulnerable body parts of the prey at which it strikes, and other snakes with the organ may detect warm bodies from a metre away. It was previously thought that the organs evolved primarily as prey detectors, but recent evidence suggests that it may also be used in thermoregulation and predator detection, making it a more general-purpose sensory organ than was supposed.
The facial pit underwent parallel evolution in pitvipers and some boas and pythons. It evolved once in pitvipers and multiple times in boas and pythons. The electrophysiology of the structure is similar between the two lineages, but they differ in gross structural anatomy. Most superficially, pitvipers possess one large pit organ on either side of the head, between the eye and the nostril (loreal pits), while boas and pythons have three or more comparatively smaller pits lining the upper and sometimes the lower lip, in or between the scales (labial pits). Those of the pitvipers are the more advanced, having a suspended sensory membrane as opposed to a simple pit structure.
In vipers, the pit organ is seen only in the subfamily Crotalinae: the pitvipers. The organ is used extensively by them to detect and target warm-blooded prey such as rodents and birds, and it was previously assumed that the organ evolved specifically for that purpose. However, recent evidence shows that the pit organ may also be used for thermoregulation. In an experiment that tested snakes' abilities to locate a cool thermal refuge in an uncomfortably hot maze, all pitvipers were able to locate the refuge quickly and easily, while true vipers were unable to do so. This suggests that the pitvipers were using their pit organs to aid in thermoregulatory decisions. It is also possible that the organ may even have evolved as a defensive adaptation rather than a predatory one, or that multiple pressures may have potentially contributed to the organ's development. The use of the heat pit to direct thermoregulation in pythons and boas has not yet been determined. Viperine snakes (which lack pit organs) also use thermal cues to guide strike behavior, but not to guide thermoregulation.