From the Daily Mail from September of 2007:
Foam swallowed an entire beach and half the nearby buildings, including the local lifeguards’ centre, in a freak display of nature at Yamba in New South Wales.
One minute a group of teenage surfers were waiting to catch a wave, the next they were swallowed up in a giant bubble bath. The foam was so light that they could puff it out of their hands and watch it float away.
It stretched for 30 miles out into the Pacific in a phenomenon not seen at the beach for more than three decades.
Scientists explain that the foam is created by impurities in the ocean, such as salts, chemicals, dead plants, decomposed fish and excretions from seaweed. All are churned up together by powerful currents which cause the water to form bubbles. These bubbles stick to each other as they are carried below the surface by the current towards the shore.
As a wave starts to form on the surface, the motion of the water causes the bubbles to swirl upwards and, massed together, they become foam. The foam “surfs” towards shore until the wave “crashes”, tossing the foam into the air.
“It’s the same effect you get when you whip up a milk shake in a blender,” explains a marine expert. “The more powerful the swirl, the more foam you create on the surface and the lighter it becomes.”
In this case, storms off the New South Wales Coast and further north off Queensland had created a huge disturbance in the ocean, hitting a stretch of water where there was a particularly high amount of the substances which form into bubbles.