© 2015 The Linnean Society of London. Countershading, or dorsal pigmentary darkening (DPD), describes a form of vertically varying coloration, where an animal typically has a dark dorsal surface and a paler ventral side, and is widespread among mammals, birds, reptiles, fishes and insects. DPD is thought to confer concealment from predators and, in terrestrial systems, there is good evidence that the dark-light transition in body coloration acts to conceal the body's shadow. Surprisingly few studies of DPD have been conducted in aquatic environments, and thus it is not known whether the mechanisms of concealment are similar to those that operate in terrestrial habitats. In this study, we determined the role of the light environment and predation risk in determining DPD in wild-caught populations of a freshwater fish, the western rainbowfish (Melanotaenia australis). We also examined the underlying mechanisms of DPD for concealment by testing the assumptions of background matching and self-shadow concealment. In a subsequent experiment, we determined whether any observed variation in DPD was maintained when the visual background was manipulated in the laboratory (to induce a change in body coloration). We found that both the amount of downwelling irradiance and the level of predation risk at the collection site affected skin darkness (dorsal, ventral and overall), whereas the ratio of dorsoventral coloration (DPD) was not affected by the parameters considered. The laboratory experiment revealed that fish changed their body coloration to match their visual background, and did so by altering the relative ratio of dorsoventral skin darkness. In contrast with research on terrestrial animals, our findings suggest that the most likely method of achieving crypsis is through background matching, rather than self-shadow concealment. It is thus possible that differences in the optical characteristics of terrestrial and aquatic environments, and/or variation in the angles at which prey are typically viewed and attacked, have resulted in divergent mechanisms of using DPD to attain crypsis.