SAN FRANCISCO — A bill in California’s Legislature could soon force ride-hailing companies like Uber and Lyft to treat their drivers as employees instead of independent contractors.

But Uber and Lyft, which contend that changing the legal status of their drivers poses a fundamental threat to their businesses, said Thursday that they would spend $60 million on a ballot initiative that would essentially exempt them from the proposed law. After their announcement, DoorDash, the food delivery service, said it would contribute an additional $30 million.

Drivers for Uber, Lyft and DoorDash work as independent contractors, logging in to the companies’ apps and providing rides or delivering food whenever they choose. They have no legally protected minimum wage, guaranteed sick days or traditional health benefits.

The drivers have routinely complained that the companies can cut their earnings without explanation and that they have no recourse if they are kicked off the apps.