Foresight is able to identify the enemy's Pokémon and allows you to hit the enemy with moves that wouldn't normally work, for example: Normal and Fighting types moves would not be able to damage Ghost types.
Does foresight guarantee a hit?
Foresight now also bypasses accuracy checks to always hit, unless the target is in the semi-invulnerable turn of a move such as Dig or Fly.
Can ghost moves normal Pokémon?
Ghost attacks are most effective against their own type, which is unique among all Pokémon attacks. They are also completely ineffective against Psychic and Normal Pokémon, even though they made a three-part series of episodes in the cartoon about how Ghosts are the best way to beat Psychics.