It's not a force that keeps the rock going, it's the lack of a resisting force to stop it. Since space is a vacuum, if there are no sufficiently massive enough objects around to "capture" it, the rock will continue on it's way. On Earth, air acts as the braking force through friction. But in...