Parametric waves arise spontaneously when a thin layer of granular mat
erial is oscillated vertically. A dynamical model of these waves accou
nting for the observed instability threshold and appearance of square
patterns is presented. The proposed instability mechanism is due to tw
o competing processes: a focusing effect that concentrates particles i
n space, and a diffusion effect that relaxes large thickness gradients
in the layer. When the layer is in a liquid-type state, close to a so
lid-liquid transition, the model correctly predicts the presence of os
cillons recently reported by P. Umbanhowar et al.