Per the Scholarly Publishing and Academic Resources Coalition (SPARC)'s guide to open access income models:
According to one survey, article processing fees are wholly or partially subsidized, either by a research grant (34%), a foundation grant (5%), or by the author’s host department (8%) or institutional library (27%). The payment of such fees out of an author’s personal funds appears relatively low—about 5% across all open access journals.
The most common sources of funding for open access publication are research grants (that allow open access fees to be charged to the grant) and institutional library funds. PLOS has compiled a list of some institutions and funders from around the world who have Open Access funds or policies to support open access publishing charges. You can check that list to see if any of those are available to you.
If none of these options are available to you, find out if the publisher can offer a fee waiver. According to the SPARC guide:
Most publishers using the model make allowances for special situations (for example, individuals without a host institution or from less developed countries), assessing lower fees or waiving fees altogether when no institutional subsidy exists. Society publishers often discount article publication fees for members, or waive them entirely.
For example, PLOS waives fees for research from eligible low-income countries and offers fee assistance for authors who have no other source of funding that covers the open access publication charges. Similarly, Elsevier offers fee waivers "in cases of genuine need." Wiley offers an automatic waiver to authors in certain eligible low-income countries, and discount to authors from another group of countries. Springer has a similar automatic waiver, and also allows authors to submit individual waiver requests.