Since we don't know the density of the beam, we don't know if there's any hope of protecting the ship from a hit. I will assume that we're not talking lightsabers here. That is, a ship could take several shots assuming it maneuvers to prevent the damage from piling up in one area.
Cover your ship in an ablative armor made to soak up the anti-matter particles and burn off. As the Ablat annihilates, the surrounding areas not directly struck but caught in the heat, burn and produce smoke/soot particles. These then also absorb anti-matter particles. The Ablat could be manufactured so the burning parts spew soot/smoke outwards, away from the ship. Now the secondary annihilations happen further from the ship. The inverse cube law is your friend.
The entire ship does not need to be covered in the thickest Ablat. WWII-era battleships were designed with a 'citadel', a part of the ship deemed critical and up-armored significantly.
An ablative armor has advantages:
- It is passive armor and works on its own
- Burning Ablat carries heat away from the ship
- It's cheap compared to the cost of the weapon it is intended to defeat
- It's easy to replace
EDIT - There were some good questions in the comments.
How does Ablat handle the radiation generated by mass annihilation?
I hadn't thought of that, but it could be made from a material good for soaking up specific types of radiation. Or not - being in space, without warfare, is extremely hazardous due to radiation. Solving that problem might help with this problem.
How does it burn in space
I was using "burning" loosely, but I'd expect the Ablat to include some oxygen in its structure. Basically, we need a chemical reaction that causes particles to be spewn forth. Given there's going to be a flash of heat, some manner of "burning" seems reasonable.
The hit of antimatter results in a horrific explosion. Thermonuclear
warfare is nowhere near in energy/volume ratio.
You don't know how damaging the beam is since the OP has not quantified the strength of the beam. So while what you say is true to my layman's ears, it does not follow that the OP's weapon is necessarily this powerful.
If an antimatter ray hits a vessel, there's no way any ablation is
going to save its surface. Emitted stream of fast particles just doesn't
work like that.
I disagree. If the beam hits, you have a choice - it hits the hull of the ship, or it hits the Ablat. It seems to be Ablat is preferred. There will surely be a hole in the Ablat due to annihilation, maybe down to the hull, who knows. The 2nd beam that hits a little later has to pass through the cloud of "smoke" and this will surely be helpful.
I agree that if the beam is dense enough to cause an energy release equal to the power of megaton (or even kiloton) nuclear weapons, there is no chance of the ship surviving unless magic is used.
This Ablative armor is not instead of other defenses such as stealth, agility, or spewing clouds of ablative dust. It is in addition to these other defenses.
EDIT 2 -
Let's talk about "beams" for a second. It is very difficult to make a beam that's not actually a conic. That is, instead of being a cylinder, the "beam" will be wider that the far end. Machinery is not perfect. Also consider the ranges we're talking about fighting. The anti-matter weapon might start out producing a beam, say, 5mm in diameter. 300,000 kilometers later, however, it might be 50m in diameter. The beam is no longer a saw, it's a shotgun. Ablative armor would be very effective against such a weapon. At close range, everyone is going to had a bad day, I think.
EDIT 3 -
The Hiroshima bomb involved about 700 milligrams of matter being converted to energy. That's about a 15KT equivalent. To get to 1.5 MT, we need 70 grams of matter converted to energy. Safety tip - if that gets loose, the firing ship is erased from the inside. And it may take a long time to generate that much anti-matter increasing the chance of a mishap. Current technology allows us to create hundreds of particles on-the-fly, and it takes the LHC to do it. Between the safety issues and practicality issues, it could be that anti-matter beams are not primary weapons but instead are dandy for point defense. Perhaps they are equivalent to the Vulcan cannons on modern ships, or the 8" guns on WWII battleships. (There is reasoned conjecture that an 8" shell from BISMARCK destroyed HMS HOOD. 8" guns' projectiles had a plunging trajectory. A different weapon for a different purpose...)