Say you put milk into an air-tight container and shake it up, what you get is foam (or more accurately, froth) on the upper surface of the milk. This is one kind of foam which has individual air bubbles trapped in water.
Foam = air trapped in an external matrix (not necessarily water) eg. foam rubber. Foam can be considered a collection of bubbles. Not very scientific, but that's what I think.