Duetting, in which 2 or more individuals call in coordinated unison, is common in birds, yet most research investigating the function of avian duets has focused only on oscine passerines. However, we have discovered that duetting occurs in 61 species (59%) in the family Rallidae (rails), one of the highest known rates in any bird clade, and that rail duets are also significantly associated with year-round territoriality and habitat type. We applied a comparative approach to study the occurrence of duetting relative to socio-ecological traits and call properties in 103 rail species, with the prediction that duetting rails produce low-frequency calls that spread well over short distances in densely vegetated habitats. Using a model correcting for phylogenetic signal, we found that duetting is the ancestral state in Rallidae, and that duetting rails show a trending effect for being sedentary and non-migratory. Contrary to our predictions, there was no significant correlation between rail duetting and social bond length, breeding system, breeding latitude from the equator, or sexual dimorphism, as year-round territoriality and forest or heterogeneous habitats were the strongest predictors of duets. Despite the prevalence of duetting in Rallidae, few studies have tested duet functions such as territory defense in this family, and our comparative phylogenetic study lays the groundwork for future research, as little remains known about the behavioral ecology and vocal interactions of many rails.