Laboratory evolution experiments suggest the potential for microbial populations to contribute significant ecological variation to ecosystems, yet the functional importance of genetic diversity within natural populations of microorganisms is largely unknown. Here, we investigated the distribution of genetic and phenotypic variation for a population of the cyanobacterium Mastigocladus laminosus distributed along the temperature gradient of White Creek, Yellowstone NP. A total of 153 laboratory strains were directly isolated from five sites with mean annual temperatures ranging between 39 and 54°C. Genetic characterization at four nitrogen metabolism genes identified 15 closely related lineages in the population sample. These lineages were distributed nonrandomly along White Creek, but the observed geographic structure could not be explained by limited dispersal capabilities. Temperature performance experiments with six M. laminosus lineages that maximized their respective relative abundances at different positions along the gradient provided evidence for niche differentiation within the population. Niche differentiation included a tradeoff in performance at high and low temperatures, respectively. The physiological variation of these lineages in laboratory culture was generally well matched to the prevailing temperature conditions experienced by these organisms in situ. These results suggest that sympatric diversification along an ecological selection gradient can be a potent source of evolutionary innovation in microbial populations.