The brown bubbles on the beach are most likely surf algae, also known as surf scum.
Surf algae are a natural phenomenon that occurs in the surf zone. They are always present, but sometimes their population explodes, resulting in large amounts of unsightly brown foam appearing in the surf and on the beach. This "bloom" is usually temporary. The foam is often mistaken for pollution, but it's a naturally occurring substance.