Mary thought the ocean would help her escape the Unconsecrated, but boy was she wrong. She also thought she could have both Travis and the freedom of life outside the Forest, which she was also pretty wrong about. But, in the last paragraph, Mary finally feels peace. She watches the ocean gobble up the dead zombies and take them out to sea. Yeah, they're still real, just like her memories and regrets, but the ocean somehow makes things better. The ocean is still her flashlight of hope, bobbing in front of her. Things didn't turn out as she'd planned, but the water makes her feel like it will still be okay.
Oh yeah, and the lighthouse man doesn't hurt, either. By taking her hand and leading her to the lighthouse—a beacon of hope, if you will—he serves as her anchor. How? He helps her find stability in a crumbling world of zombies. If he can survive, so can she.
With the ocean on one side, the man on the other, and a lighthouse up ahead, Mary might as well be invincible.