Second-generation sequencing technologies are revolutionizing the study of metagenomes. Whole-genome shotgun sequencing of metagenomic DNA may become an attractive alternative to the current widely used ribosomal RNA gene studies. Large data sets of short sequence reads are mapped onto a custom microbial reference sequence. If a bacterial pangenome of completely sequenced genomes is taken as a reference, the output consists of the distribution of bacterial taxa in and bacterial gene contents of the metagenome. The relative abundance of functional categories and of individual pathways and fitness traits encoded by the metagenomic gene pool provides insight into habitat-specific features of the microbial community. Polymorphic sites in sequence reads may resolve the number and abundance of individual clonal complexes of dominant species in the polymicrobial community. These SNPs and de novo mutations may be exploited to trace the spatiotemporal spread of clones and the emergence of novel traits such as fitness or resistance determinants. In conclusion, massively parallel sequencing of metagenomic DNA allows deep insights into the composition and the genetic repertoire of polymicrobial communities.