Foam is not normal near bottling time, it usually means that fermentation is still happening - that is, it is not bottling time.

A few bubbles can be formed just from loss of CO2 (from a rise in temperature for example), but the best way to be sure is measure the specific gravity. See [this thread](http://homebrew.stackexchange.com/questions/8134/so-i-dont-know-if-my-primary-is-done/8135#8135).

Especially note, as the above thread points out, it's good to be patient.