IMO, that Ranger got that shot because of a general rules ability available to all characters, similar to Attacks of Opportunity (It may very well be replacing AoO). We've already seen a similar example in another article.
Here we've got two examples of what triggers an Immediate Action...