If the spider started at a corner diagonally on the same face as the ant the answer would be 9, and if the spider started at an adjacent corner the answer would be 7.
Here are answers for other figures:
Square: 4
Octahedron: 6
Dodecahedron: 35
Icosahedon: 15
Michael Shackleford, A.S.A.