According to Newton's first law, without any forces bodies save their state of rest or motion. Since you tossed a ball, it will continue going along direction of the force you initially exerted in a straight line. What would happen after collision with the spaceship's walls is frankly speaking unpredictable because you don't know configuration of the surfaces that the ball will hit, but what we can say is that after each collision the ball will move in straight lines.