That is a good question.
Ostensibly, not by the RAW, because your target for said action is no longer valid if you can't reach him. However, the RAW is sometimes silly, so I'd rule that as a yes.
Particularly if the Ranger is dumb enough to retreat behind someone not a defender =p