Even though the beam of the gamma ray burst is incredibly focused, it still dissipates as it travels, like a searchlight beam (or even a laser). Nearly all GRBs that we detect are from really far away and so are not a threat. If one happens "nearby" and it was pointed at the earth, we'd be cooked! But they are extremely rare events.