Press the space bar to throw the ball, then use the arrow keys to help Marvin fetch the ball.
If the penguin isn't holding the ball after Marvin fetches it, bring him to the ball and press space.