I can only say that if I saw an unidentified, foul-smelling foam building up near the beach, I'd probably show a little more restraint before diving in. I can't deny I'd be curious, but I'd rather know what it's made of BEFORE I cover myself with it from head to toe. Ick.
There's some debate as to the cause, but one theory is...
Dr Kutboke said when sea droplets mixed with crude oil discharged from passing ships or motor oil and sewage from stormwater run-off, and became mixed in ocean turbulence, the resulting emulsion became more persistent than the original oil and appeared as “chocolate mousse”.
Sounds like a recipe for fun!