What happens when you run out of money for legal counsel during divorce proceedings?

In some states a petitioner can request the court to appoint a mediator to attempt to resolve the matters of contention. Other than that the person contesting the action can try legal aid associations or women's or men's legal help centers and so forth. Unfortunately most such organizations are underfunded and have large case loads, making any legal assistance that is not an emergency very difficult to obtain.