Bacterial biofilms are organized communities of cells living in association with surfaces. The hallmark of biofilm formation is the secretion of a polymeric matrix rich in sugars and proteins in the extracellular space. In Bacillus subtilis, secretion of the exopolysaccharide (EPS) component of the extracellular matrix is genetically coupled to the inhibition of flagella-mediated motility. The onset of this switch results in slow expansion of the biofilm on a substrate. Different strains have radically different capabilities in surface colonization: Flagella-null strains spread at the same rate as wild type, while both are dramatically faster than EPS mutants. Multiple functions have been attributed to the EPS, but none of these provides a physical mechanism for generating spreading. We propose that the secretion of EPS drives surface motility by generating osmotic pressure gradients in the extracellular space. A simple mathematical model based on the physics of polymer solutions shows quantitative agreement with experimental measurements of biofilm growth, thickening, and spreading. We discuss the implications of this osmotically driven type of surface motility for nutrient uptake that may elucidate the reduced fitness of the matrix-deficient mutant strains.