The recognition of compatible mating partners in the basidiomycete fungi requires the coordinated activities of two gene complexes defined as the mating-type genes. One complex encodes members of the homeobox family of transcription factors, which heterodimerize on mating to generate an active transcription regulator. The other complex encodes peptide pheromones and 7-transmembrane receptors that permit intercellular signalling. Remarkably, a single species may have many thousands of cross-compatible mating types because the mating-type genes are multiallelic. Different alleles of both sets of genes are necessary for mating compatibility, and they trigger the initial stages of sexual development--the formation of a specialized filamentous mycelium termed the dikaryon, in which the haploid nuclei remain closely associated in each cell but do not fuse. Three species have been taken as models to describe the molecular structure and organization of the mating-type loci and the genes sequestered within them: the pathogenic smut fungus Ustilago maydis and the mushrooms Coprinus cinereus and Schizophyllum commune. Topics addressed in this review are the roles of the mating-type gene products in regulating sexual development, the molecular basis for multiple mating types, and the molecular interactions that permit different allelic products of the mating type genes to be discriminated. Attention is drawn to the remarkable conservation in the mechanisms that regulate sexual development in basidiomycetes and unicellular ascomycete yeasts, Saccharomyces cerevisiae and Schizosaccharomyces pombe, a theme which is developed in the general conclusion to include the filamentous ascomycetes Neurospora crassa and Podospora anserina.