Meet with an attorney. She may be eligible for a provisional waiver but she would have to return to Mexico. An attorney can discuss in detail what would be your best option.
Samuel Ouya Maina, Esq. 415.391.6612 email@example.com Law Offices of S. Ouya Maina, PC 332 Pine Street, Suite 707 San Francisco, CA 94104
Contact you state authorities for specific information and documentary requirements for the marriage procedure. Depending on what you call illegal, she may need to return to Mexico at some point.
Generally, if a person has entered the US illegally and then marries a US citizen they will need to apply for a waiver and then leave the US for a period of time before reentering legally.
You will need to hire a qualified immigration attorney to assist you with this process.