I had a similar repair job last year - cracked fireback, spalling brick, and some loose mortar. I ended up getting proper help through emersonproservices.com. They were quick to assess what was safe to DIY and what needed a pro. Turns out some of the damage was way deeper than I thought...
I used fire cement to fill gaps like that before, then smoothed it with a damp sponge once it started setting. Just make sure everything's dry and clean first.