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 threadthis thread.
Especially note, as the above thread points out, it's good to be patient.