Bacteria that use quorum sensing produce and excrete a certain signaling compound (called autoinducer or pheromone), and have a receptor that can specifically detect the inducer. When only a few other bacteria of the same kind are in the vicinity, diffusion reduces the concentration of the inducer in the surrounding medium to almost zero. With many bacteria of the same kind, the concentration of the inducer passes a threshold, whereupon the receptor activates certain responses in the bacterium, often the transcription of certain genes and their translation into proteins.
The purpose of quorum sensing is to coordinate certain behaviour or action between bacteria of the same kind, depending on their number. For example, opportunistic bacteria can continue to grow within a host without harming it, until they reach a certain number. Then, when they are strong enough to turn into disease, behave aggressively.
Quorum sensing was discovered by Bonnie Bassler. The first organism quorum sensing was discovered in is vibrio fischeri, a luminiscent bacterium that lives as a symbiote in the light-producing organ of deep-sea cuttlefish. Upon reaching a certain number within this organ, they "turn on the light" by producing a luminiscent compound which provides the cuttlefish with a "spotlight".
A first X-ray structure of a receptor (LuxP) was discovered in vibrio harveyi in 2002, together with its inducer (AI-2), which is the first biomolecule discovered containing boron (Nature 415, 545ff PDF).