Hox genes are conserved transcription factors that determine body segment identity and organization, with homologs shared across all animals. Changes in Hox gene expression and sequence can produce dramatic shifts in body plans with relatively few genetic changes. The Hox cluster organization and collinearity are products of evolution from an ancestral cluster.
You already know from gene expression that transcription factors bind DNA to activate or silence target genes. Hox genes are a special family of transcription factors with a unique property: they tell each body segment what to become. Think of them as an address system — they do not build structures directly, but they tell cells "you are in the head region" or "you are in the abdomen," and the cells then activate the appropriate downstream genes for that identity. Without Hox genes, a body would be a series of identical repeating segments with no differentiation between head, thorax, and tail.
The most striking feature of Hox genes is collinearity: the order of Hox genes along the chromosome matches the order of body regions they specify, from anterior to posterior. The gene at the 3' end of the cluster is expressed in the head, the next gene in the next segment, and so on down to the gene at the 5' end, which is expressed at the tail. This spatial correspondence between chromosome position and body axis position is conserved from insects to humans, which is remarkable evidence of a shared ancestor. In mammals, the ancestral Hox cluster has been duplicated into four clusters (HoxA through HoxD), giving 39 total Hox genes that work in overlapping combinations to specify even finer segment identities along the body.
The evolutionary power of Hox genes lies in what happens when their expression patterns change. A classic demonstration is the Antennapedia mutation in fruit flies, where a Hox gene is misexpressed in the head, causing legs to grow where antennae should be. The legs themselves are perfectly formed — the cells simply received the wrong address and built the wrong structure. This shows that major morphological changes can result not from building new developmental programs, but from deploying existing programs in new locations. Changes in Hox gene regulation — where and when they turn on — can reshape body plans without requiring entirely new genes.
This is why Hox genes sit at the center of evo-devo (evolutionary developmental biology). The same toolkit of Hox genes is shared across the animal kingdom, from worms to whales, yet the enormous diversity of body plans arises largely from differences in how and where these genes are expressed. Snakes, for instance, have extended their thoracic Hox expression domains, producing hundreds of rib-bearing vertebrae instead of the typical mammalian pattern. Evolution does not need to invent new body-patterning genes; it tinkers with the regulatory switches controlling the ancient ones it already has.