The 60-page filing, presented in San Francisco Superior Court, alleges that the companies sell rights to Web advertisements based on searches for terms such as "illegal gambling," "Internet gambling" and "California gambling."
The online businesses also use geotracking software to target particular regions, including California, for illegal gambling ads, according to the lawsuit.
The lawsuit demands that the companies stop accepting the advertisements and give California "millions of dollars in ill-gotten gains," said attorney Ira Rothken, one of several attorneys from firms involved in the class-action lawsuit.
The suit is the latest to involve Internet gambling, which has become a multibillion-dollar-a-year business and is usually focused on online poker or blackjack. Wireless interests, including European cell phone service providers, also offer gambling opportunities to their subscribers.
Yahoo and Google, in turn, rake in a majority of the millions of dollars gambling firms spend on advertising, according to the lawsuit. Representatives from the two companies did not return a call seeking comment.
In all, about a dozen high-profile Web companies are named as defendants. Included among them is CNET Networks, publisher of News.com.
New Galaxy S10 phones bring it: Meet the Galaxy S10, S10 Plus, "cheap" Galaxy S10E and Galaxy S10 5G.
Everything Samsung showed at Unpacked: We're adding all the photos from the event along with all the new hardware.
Discuss: Major Web sites hit with suit over gambling ads
Be respectful, keep it civil and stay on topic. We delete comments that violate our policy, which we encourage you to read. Discussion threads can be closed at any time at our discretion.