Middle English fom, fome (c. 1300), from Old English fam "foam, saliva froth; sea," from West Germanic *faimo- (source also of Old High German veim, German Feim), from PIE root *(s)poi-mo- "foam, froth" (source also of Sanskrit phenah; Latin pumex "pumice," spuma "foam;" Old Church Slavonic pena "foam;" Lithuanian spainė "a streak of foam"). The plastic variety used in packaging, etc., so called from 1937.
Old English famgian "to emit foam, to boil," from the source of foam (n.). Sense of "become foamy, to froth" is from late 14c. Transitive sense is from 1725. Related: Foamed; foaming.