Spears = ranged weapons. Range = 2. Next question.
That depends whether or not they're always treated as ranged/thrown weapons. If so, IYF will work against them only if the person with the perk is exactly next to the one with spear.
If they're treated as melee however, IYF will work starting from the 2nd square.
It might be possible that the game can tell the difference between the weapon mode (f.ex thurst/throw) and is changing the weapon type depending on what atk type you currently have chosen.