SHORT ANSWER:
YOU ARE THE WRITER AND THE CREATOR GOD OF YOUR FICTIONAL UNIVERSE, SO YOU CAN ARRANGE VARIOUS FACTORS TO MAKE IT MORE OR LESS PROBABLE
LONG ANSWER:
PART ONE OF TWO: WITH A FASTER THAN LIGHT TYPE OF SPACE RADAR TO DETECT THE INCOMING ENERGY BEAM
If no form of faster than light energy technology is available in this fictional setting, go to Part Two.
If Ship B uses some hypothetical fictional type of faster than light (FTL) radiation for some type of FTL space radar it can detect the beam being fired at it and thus decide to move out to the way of the beam.
If Ship B could travel at exactly the speed of light perpendicular to the direction to Ship A it could travel 1 AU before the ray beam reaches its former position. So unless the ray beam can expand at a 45 degree angle and still be deadly at a distance of 1 AU, the target spaceship would be out of the danger zone and the ray beam would pass harmlessly past it without hitting it.
So if technology in this era has advanced to use the FTL radiation for FTL space radar but not yet advanced enough to use the FTL radiation for FTL death rays, the target spaceship, Ship B, can detect and dodge incoming death rays coming at the speed of light.
And when one side manages to use FTL radiation for its death rays before the other side does, it should be able to destroy enemy ships because they won't be able to dodge in time.
Of course in this example Ship B was able to dodge the death ray because it could travel perpendicular to the death beam at the speed of light.
But if Ship B uses any reasonably plausible form of rocket drive or advanced anti gravity space drive, it will not be able to instantly accelerate at the speed of light. In the 8.3 minutes until the death beam reaches the former position of Ship B, that target space ship could reach only a tiny fraction of the speed of light and thus travel only a tiny fraction of 1 AU out of the way.
So the question should be can Ship B travel at a tiny fraction of the speed of light far enough out of the way of the energy beam that it won't be harmed by the energy beam.
So if Ship B can instantly detect the incoming energy beam by using some sort of FTL space radar, how wide will the energy beam spread as it travels a distance of 1 AU while still remaining intense enough to destroy a spaceship that it hits? That will determine the sideways distance Ship B will have to travel in 8.3 minutes in order to be safe. And can Ship B travel fast enough and far enough to get out of the danger zone in 8.3 minutes?
TV Tropes has a trope called: https://tvtropes.org/pmwiki/pmwiki.php/Main/ScifiWritersHaveNoSenseOfScale1
And another trope called: https://tvtropes.org/pmwiki/pmwiki.php/Main/WritersCannotDoMath2
And I personally hate those tropes and i encourage all science fiction, Sci-fi, fantasy, Horror, etc., etc, writers to get a sense of scale and also to do the math, and to be exceptions to those all too common tropes.
You, as the writer of your story, and the creator god of your fictional universe, can set up various factors such as the distance that energy beams are deadly at, and how wide they spread at various distances while still being intense enough to be deadly, and how fast your space warships can accelerate, to make whatever situation you desire in your story.
So you can arrange those factors so that a spaceship with some type of FTL space radar can always detect an energy beam travelling at the speed of slight and dodge out of the way of that energy beam in time to avoid it.
Or you can arrange those factors so that even a spaceship with some type of FTL space radar can never detect an energy beam travelling at the speed of slight and dodge out of the way of that energy beam in time to avoid it.
Or you can arrange those factors so that a spaceship with some type of FTL space radar can sometimes detect an energy beam travelling at the speed of slight and dodge out of the way of that energy beam in time to avoid it. Whether or not a particular spaceship such as Ship B with some type of FTL space radar detects an specific energy beam traveling at the speed of light fired by a specific enemy space ship at a specific distance (1 AU in your example) in time to dodge it safely will depend on the exact values of some specific variables in the circumstances which you, the writer and the creator god, can dictate for that specific situation.
But you face some limitations since there may be other parts of your story where the properties of FTL space radar, light speed energy beams, and spaceship acceleration rates, may also be important. And possibly you might find that the values necessary for one story situation to have the result you desire may be different from the values necessary for another story situation to have the result you desire.
PART TWO: NO FTL SPACE RADAR
If There is no technology using some hypothetical fictional type of faster than light (FTL) radiation for a type of FTL space radar equivalent, there is absolutely no way for the target spaceship, Ship B, to detect the incoming energy beam when it is fired or when it is on the way. Ship B will not know that Ship A is firing upon it until the energy beam strikes Ship B.
Then, there might be time to react to being hit by the energy beam. If the energy beam has to be on the target for 20 seconds in order to destroy it, and Ship B manages to get out of the beam in only 10 seconds, Ship B should survive, though possibly the crew might have lost some years off of their lives due to being in the deadly energy beam for 10 seconds.
On the other hand, the energy beam might destroy the target if it hits the target for a full 0.1 of a second. The human crew of Ship B would not be able to react fast enough to being hit to more Ship B out of the way in 0.1 second. Computers could possibly make the decision fast enough. But how far could Ship B travel in 0.1 second with an acceleration gentle enough for the crew to survive? And could it travel far enough, perpendicular to the energy beam, in 0.1 second to get out of the energy beam?
So if the crew of Ship B can't detect when Ship A fires at them, and can't detect which way the beam is fired, they can only make guesses about those matters and dodge according to their best guesses. Or they can dodge randomly, making evasive maneuvers.
So if ship B knows where Ship A is, Ship B can move at a randomly selected direction that is perpendicular to the direction to Ship A, and move in that randomly selected direction for a randomly selected period of time until turning to another randomly selected direction for another randomly selected amount of time. And so on and son on. Each randomly selected direction would have be perpendicular to the direction to ship A, of course.
Thus shop B would hope to make it harder for ship A to compute their future position when aiming at Ship B. And also hope to possibly, by chance, move out of the way of the energy beam fired by Ship A.
Consider the other ship, Ship A, deciding when to fire the energy beam at Ship B, and deciding to do so when the two ships are separated by a distance of 1 AU, which is equal to 149,597,870.7 kilometers or 92,956,000 miles.
As you say, light takes about 8.3 minutes to travel 1 AU. So the energy beam on Ship A will be aimed at the direction to Ship B 8.3 minutes ago. And the energy beam from Ship A which reach the former position of Ship B after traveling for 8.3 minutes, and thus will hit where Ship B was 16.6 minutes earlier.
So the person who pulls the trigger on Ship A will do so knowing that the energy beam will hit where Ship B was 16.6 minutes before the beam hits. So why should they fire at where the target was 8.3 minutes before firing, and where the target was 16.6 minutes before the beam will reach that position? They shouldn't fire at all, unless they know that Ship B can not possibly get out of the way of the energy beam in a mere 16.6 minutes.
Do the space ships in this setting have rocket engines and not some hypothetical super advanced form of space drive?
If Ship B will use rockets to get out of the way, what is the maximum acceleration that the crew of Ship B can survive for 16.6 seconds? That maximum acceleration will determine the maximum distance that ship A can travel in a straight line perpendicular to the direction to ship A in 16.6 minutes. And that in turn will enable someone to calculate the total distance that Ship B can possible travel from where the energy beam is fired at during a time of 16.63 seconds, and thus whether it is possible for Ship B to get out of the cone of destruction of the energy beam in 16.6 minutes.
What if Ship B doesn't have rocket engines but some type of hypothetical space drive that uses anti gravity or something to accelerate much faster than a rocket can, without the crew feeling or being crushed to death by that acceleration?
In that case, Ship B could travel much farther in 16.6 minutes than if it had only rocket engines, and thus it could be much farther from its original position when the energy beam arrives at its original position.
And again, it should be fairly easy from someone who knows about the engines on Ship B to calculate how far it could possibly get from one position in 16.6 minutes. Thus it should be routinely simple to calculate whether Ship B can possibly get out of the way of an energy beam in 16.6 minutes.
The firing officer on Ship A will know how long it will take the energy beam to reach where ship B was 8.3 minutes before firing. And he will know that his energy beam, no matter how concentrated, will gradually spread out over time and distance until eventually it will be too thin to be deadly. And the firing officer will also know how wide the energy beam will spread, and how deadly the energy beam will be, at any specific distance, such as the 1 AU in your example.
And I see no reason for the firing officer to push the button or pull the trigger unless they know:
1) That the beam will be intense enough at a distance of 1 AU to destroy Ship B.
and also:
2) That the beam will spread out far enough travelling 1 AU that Ship B can not possible get out of the energy beam even at maximum acceleration for 16.6 seconds.
I suppose that some more optimistic firing officers might fire if they believe that it was merely probable that both factors applied, especially if the beam weapon could recharge and shoot again rapidly.
But I strongly doubt that an energy beam powerful enough to destroy a space ship at a distance of 1 AU, despite spreading out and weakening countless millions of times over the distances, could be recharged in seconds or minutes.
If ship A is firing at Ship B at a distance of 1 AU, and if both ships probably come from planets in the same star system, since they don't have a faster than light drive, it doesn't seem like ordinary patrol ship A firing at ordinary patrol ship B to me.
Instead it seems more like Deathstar A firing at Deathstar B, or The Skylark of Valeron firing at Skylark DuQuesne (minus the interstellar setting of those stories, of course). Each ship should be the supreme ultimate weapon of its planet.
And I can believe that the supreme ultimate weapon of an advanced society would probably take hours, days, weeks, months, years, or decades to be recharged or refueled each time it is fired, if it doesn't destroy itself as well as the target the first time it fires anyway. I find it really hard to believe that the supreme ultimate weapon in a space war could fire as rapidly as every few seconds or every few minutes.
So I have to believe it is extremely probable that the firing officer on Ship A won't fire unless absolutely certain that the energy beam will hit and destroy Ship B.
So if Ship B can not use some short of FTL space radar to detect the energy beam fired by Ship A and get out of the way, Ship B should be doomed. It should be impossible for Ship B to take any type of evasive action sufficient to evade the energy beam from Ship A.
Ship A should never fire its super powerful energy beam at Ship B until it is impossible for Ship B to avoid being hit by the energy beam.
The relatively good news for ship B is, if it has a similar super powerful energy beam, it might fire its own beam at Ship A sometime before being hit and destroyed. Thus ship A might possibly also be destroyed in the conflict.
One possible variation on this scenario might be an assassination attempt instead of a regular space battle.
Someone important enough for others to want to kill them is traveling on a spaceship, Ship B, from one place to another using a more or less easily predictable trajectory. Their enemies have calculated that trajectory, and they position Ship A at a position 1 AU away from a spot where ship B will be at a specific calculated time. And 8.3 minutes before Ship B will be at that spot, Ship A fires the beam weapon at the location where ship B will arrive in 8.3 minutes.
This is the perfect murder, in so far as it being impossible for the victim to do anything to escape assassination, or even to know about it before they die.
But what if living or cybernetic spies aboard Ship A report their plans to Ship B using secret transmitters? Then Ship B can try to change its course to avoid being blasted by the energy beam, and possibly also try to shoot at ship A.
And if there are spies aboard Ship B, they might report the attempted evasion maneuvers to Ship A. And with messages taking 8.3 minutes to arrive from one sip to another, and thus possibly being 8.3 minutes out of date, the game of cat and mouse might continue for some time.
TV Tropes has a trope called: https://tvtropes.org/pmwiki/pmwiki.php/Main/ScifiWritersHaveNoSenseOfScale1
And another trope called: https://tvtropes.org/pmwiki/pmwiki.php/Main/WritersCannotDoMath2
And I personally hate those tropes and i encourage all science fiction, Sci-fi, fantasy, Horror, etc., etc, writers to get a sense of scale and also to do the math, and to be exceptions to those all too common tropes.
You, as the writer of your story, and the creator god of your fictional universe, can set up various factors such as the distance that energy beams are deadly at, and how wide they spread at various distances while still being intense enough to be deadly, and how fast your space warships can accelerate, to make whatever situation you desire in your story.
You can arrange those factors in your setting to make the story happen as you wish.
And if Ship B doesn't have any sort of FTL space radar, it can only be warned of the attack by spies aboard ship A sending a message ahead of time about what Ship A plans to do. And since Ship A can change its plans between the message being sent and actually firing the weapon, the information sent by the spies could be out of date and misleading.
As the writer you face some limitations since there may be other parts of your story where the properties of FTL space radar (if any in your story), light speed energy beams, and spaceship acceleration rates, may also be important. And possibly you might find that the values necessary for one story situation to have the result you desire may be different from the values necessary for another story situation to have the result you desire.
But it is up to you, the writer of the story, and the creator god of your fictional universe, to try to create a story that is as interesting, and a fictional universe that is as consistent believable, as you can.