Patterns of species occurrence and abundance are influenced by abiotic factors and biotic interactions, but these factors are difficult to disentangle without experimental manipulations. In this study, we used observational and experimental approaches to investigate the role of temperature and interspecific competition in controlling the structure of ground-foraging ant communities in forests of the Siskiyou Mountains of southwestern Oregon. To assess the potential role of competition, we first used null model analyses to ask whether species partition temporal and/or spatial environments. To understand how thermal tolerances influence the structure of communities, we conducted a laboratory experiment to estimate the maximum thermal tolerance of workers and a field experiment in which we added shaded microhabitats and monitored the response of foragers. Finally, to evaluate the roles of temperature and interspecific competition in the field, we simultaneously manipulated shading and the presence of a dominant competitor (Formica moki). The foraging activity of species broadly overlapped during the diurnal range of temperatures. Species co-occurrence patterns varied across the diurnal temperature range: species were spatially segregated at bait stations at low temperatures, but co-occurred randomly at high temperatures. The decreased abundance of the co-occurring thermophilic Temnothorax nevadensis in shaded plots was a direct effect of shading and not an indirect effect of competitive interactions. Thermal tolerance predicted the response of ant species to the shading experiment: species with the lowest tolerances to high temperatures showed the greatest increase in abundance in the shaded plots. Moreover, species with more similar thermal tolerance values segregated more frequently on baits than did species that differed in their thermal tolerances. Collectively, our results suggest that thermal tolerances of ants may mediate competitive effects in habitats that experience strong diurnal temperature fluctuations.