This is generally because your CO2 pressure is too high or the beer is too cold — or a combination of the two. Getting this just right may take a bit of experimenting, but the result should be a perfectly carbonated beer with a solid head.