Some cyanobacteria (oxygenic phototrophs) grow as chains of vegetative cells (filaments or trichomes). When placed in media lacking combined nitrogen, some cells in the filaments differentiate into N-2-fixing heterocysts. The nitrogen fixation system is inactivated by oxygen, and the heterocyst provides a micro-oxic environment for nitrogenase to function. In this review, we first describe the special envelope and metabolism that makes the heterocyst micro-oxic, to concentrate then on the regulation of gene expression during the process of differentiation. Differentiation starts as a response to a persistent high cellular carbon-to-nitrogen balance signalled by 2-oxoglutarate, which results in activation of the global transcriptional regulator NtcA followed by increased expression, mainly localized to differentiating cells, of the hetR (encoding the differentiation-specific transcription factor HetR) and ntcA genes. The expression of genes encoding proteins that transform the vegetative cell into a heterocyst is then activated with a spatiotemporal specificity to produce a mature functional heterocyst. Recent global analyses have added information on time course and levels of gene expression during the process of differentiation, and much information is also available on the promoters of a number of these genes. Contiguous promoters building complex promoter regions are common among heterocyst-related genes. Understanding the molecular mechanism of operation of these promoters, including the roles of HetR and NtcA, is a major goal of research in this field.