Sable uses his amazing cone of shame (and his ability to make up physics) to...um...get the cookie!
...No wait, that sounds stupid.
How about...using the Rayquaza body his soul possessed at some point in the shoutbox, he flies into space and gets the cookie! He boards the ship, too, but it's kinda cramped in there for a Rayquaza.