See: http://blogs.testbit.eu/timj/2005/06/23/23062005/ (page moved)
How’s nature forming interesting patterns such as the surface of sea shells, or simply telling apart the places to grow a head and a leg?
The mathematical explanation describes this by the interaction of an activator and an inhibitor which are produced in a concurrent, mutually influenced reaction with varying diffusion properties. Basically, this allowes local activation (activator) with lateral inhibition (inhibitor), i.e. an attribute emerges at a certain location and is suppressed in the near surroundings, but may be repeated in surrounding regions farther away.
The result is: structure! Structure, which emerges out of a homogeneous cell mass where all cells contain the same operational program (gene code). This page has a good explanation on the reaction details. By tweaking various properties of the fundamental two differential equations that describe this process, many aspects of pattern formation can be explained. Large gradients (inhibitor concentrations) can be used to form global coordinate systems which are suitable to control whole body formation, repeated small gradients (activator concentrations) allow for oscillation (pigment patterns of sea shells) or near optimal attribute coverage on surfaces (hairs).