  This paper considers the Alt-Caffarelli free boundary problem in a periodic
medium. This is a convenient model for several interesting phenomena appearing
in the study of contact lines on rough surfaces, pinning, hysteresis and the
formation of facets. We show the existence of an interval of effective pinned
slopes at each direction $e \in S^{d-1}$. In $d=2$ we characterize the
regularity properties of the pinning interval in terms of the normal direction,
including possible discontinuities at rational directions. These results
require a careful study of the families of plane-like solutions available with
a given slope. Using the same techniques we also obtain strong, in some cases
optimal, bounds on the class of limit shapes of local minimizers in $d=2$, and
preliminary results in $d \geq 3$.
