We present a theoretical and experimental treatment of three-phase flo
w in water-wet porous media from the molecular level upwards. Many thr
ee-phase systems in polluted soil and oil reservoirs have a positive i
nitial spreading coefficient, which means that oil spontaneously sprea
ds as a layer between water and gas. We compute the thickness and stab
ility of this oil layer and show that appreciable recovery of oil by d
rainage only occurs when the oil layer occupies crevices or roughness
in the pore space. We then analyze the distribution of oil, water and
gas in vertical equilibrium for a spreading system, which is governed
by alpha = gamma(ow) (rho(o) - rho(g))/gamma(go)(rho(w) - rho(o)), whe
re gamma(ow) and gamma(go) are the oil/water and gas/oil interfacial t
ensions respectively, and rho(g), rho(o) and rho(w) are the gas, oil a
nd water densities respectively. If alpha > 1, there is a height above
the oil/water contact, beyond which connected oil only exists as a mo
lecular film, with a negligible saturation. This height is independent
of the structure of the porous medium. When alpha < 1, large quantiti
es of oil remain in the pore space and gravity drainage is not efficie
nt. If the initial spreading coefficient is negative, oil can be trapp
ed and the recovery is also poor. We performed gravity drainage experi
ments in sand columns and capillary tubes which confirmed our predicti
ons.