Solved this one a long time ago....shake the bottle in more of a horizontal (at 45 degree angle or less) motion instead of vertical. It makes it easier for air to get in so the ketchup can pour out.
No chemistry needed just physics
Try it

Woodncoal is right though...squeeze bottles have pretty much taken over.