Does a ranger get his favored terrain bonus if he is within the area of a hallucinatory terrain spell which simulates his favored terrain (but is not his favored terrain otherwise)?
And this may allow him to receive the +4 bonus and grant him a will save against the illusion, depending on your GM's interpretation of how illusion magic works.