The dose imparted by a small non-equilibrium photon radiation field to the sensitive volume of a detector located within a water phantom depends on the density of the sensitive volume. Here this effect is explained using cavity theory, and analysed using Monte Carlo data calculated for schematically modelled diamond and Pinpoint-type detectors. The combined impact of the density and atomic composition of the sensitive volume on its response is represented as a ratio, Fw,det, of doses absorbed by equal volumes of unit density water and detector material co-located within a unit density water phantom. The impact of density alone is characterized through a similar ratio, Pρ -, of doses absorbed by equal volumes of unit and modified density water. The cavity theory is developed by splitting the dose absorbed by the sensitive volume into two components, imparted by electrons liberated in photon interactions occurring inside and outside the volume. Using this theory a simple model is obtained that links Pρ - to the degree of electronic equilibrium, see, at the centre of a field via a parameter Icav determined by the density and geometry of the sensitive volume. Following the scheme of Bouchard et al (2009 Med. Phys. 36 4654-63) Fw,det can be written as the product of Pρ -, the water-to-detector stopping power ratio [L[overline](Δ)/ρ](w)(det), and an additional factor Pfl -. In small fields [L[overline](Δ)/ρ](w)(det) changes little with field-size; and for the schematic diamond and Pinpoint detectors Pfl - takes values close to one. Consequently most of the field-size variation in Fw,det originates from the Pρ - factor. Relative changes in see and in the phantom scatter factor sp are similar in small fields. For the diamond detector, the variation of Pρ - with see (and thus field-size) is described well by the simple cavity model using an Icav parameter in line with independent Monte Carlo estimates. The model also captures the overall field-size dependence of Pρ - for the schematic Pinpoint detector, again using an Icav value consistent with independent estimates.