Well, it's certainly illegal in most circumstances to discriminate against someone in the workplace because they are age 40 or older. The good news is that, unlike most other lawsuit types, there are federal and state laws to protect the worker, and the governments can even independently initiate prosecution of a civil case on behalf of the victim.
Complaints can be filed with the EEOC
or California's Department of Fair Employment and Housing (DFEH) directly. If you file with one, they will work in tandem with the other. Most people find filing with DFEH easier because you can file online or by telephone. Here is their information: http://www.dfeh.ca.gov/
Once a complaint is filed, an investigation will ensue. At the conclusion of the investigation, the governmental entity will determine whether to allow the matter to be prosecuted independently by the victim or to initiate prosecution on the victim's behalf.
Be aware that certain deadlines exist for filing a complaint. Generally, any charge of discrimination
should be filed as soon as possible. I recommend seeking counsel on all of these matters immediately, but especially if it appears that more than six months might pass before filing. Generally the EEOC accepts charges of discrimination in California up to 300 days from the date of the discriminatory act and the DFEH accepts complaints of discrimination up to one year from the date of the discriminatory act. I hope that this helps.