Newtons 3rd law of motion states the every action has an equal and opposite reaction, so in space with no gravity and no friction the ship would move in what ever direction it was pushed forever, until it would reach some kind of gravitational pull.
Hope this was right, =]
JT