Most journals are hybrid now, and offer a choice when publishing- either it's free for the author but kept behind a paywall, or the author pays up front. The article processing charges are really expensive- BMJ is £3,500, Lancet $5000, Cell $5,200 etc, although some major funders have arranged 'site licenses' with publishers so that all their funded research can be published open access without charge to the scientist.