Surprise is supposed to be merely awareness of the presence of opposition. The OP description suggests that the hobgoblin and ranger ARE aware of each other at the same time. Then it becomes necessary for the dm to either GRANT initiative to the ranger or give him a bonus to his roll and accept that the normal, random consequences of combat then still apply.
This seems the best call, imo, on this situation, as it falls within RAW.
Excellent comment, Man. Thanks for posting this.
The DMG states that awarness can often be determined with Listen or Spot checks. There's also the "advantaged/disadvantaged" rule from the skills section of the PHB. And, the DMG speaks of quality of results on some throws.
I think the way to handle the situation in the OP is this:
First, give the Ranger a +2 Initiative bonus (the advantaged rule). Having a weapon at the ready like that will normally gain the character a +2 Nish bonus.
Second, per the DMG, give the Hobby a Listen check to see if he hears the Ranger coming around the corner. I think a DC 16 sounds about right. That's a DC 10 (Average) +1 per 10 feet.
For every point that the Hobby throws above 16 (17 = +1, 18 = +2, etc.), the Hobby nets that bonus to his Initiative throw. Thus, if the Hobby throws 19 on his Listen check, then he's +3 on his upcoming Nish throw.
If the Hobby fails the Listen throw, then the Ranger is given an additional bonus for every point of failure. For example, if the Hobby throws a 14 on this Listen check, then the Ranger gets a +2 bonus on his upcoming Nish check (in addition to the +2 bonus he got for having his weapon nocked).
If the Hobby failes by 5 points or more (rolling an 11 or less), this means that the Hobby was Surprised. Give the Ranger his Surprise Action (at which time he can fire his bow, if he wants), and then do initiative normally provided the Hobby is still standing. (This is a use of the degree of success rule from the DMG.)
Everything I've stated there is 100% RAW, from the book, and I think it handles the situation nicely--with various outcomes.
Thanks again, Man!