Helldritch
Hero
Yes and no.Doesn't the anti magic turn off the eye ray?
As an interaction, on its turn, the beholder can close its central eye. Go crazy with eye rays and reopen its central eye when things are done. Remember the anti-magic property of the central eye cease as soon as someone leaves the area of effect or the central eye is closed. Blinking an eye is not against the rule and this is how beholders have been played like forever. What the beholder must choose is what will the area of effect be. Nothing more, nothing less. And even with the central eye closed, the beholder is never blind. So if players start to "ready action" to use spells as the central eye closes, the beholder will notice how the characters are acting and will simply keep an eye on the casters, and shoot.
Of course you can always rule that the casting is occurring during the character's initiative and thus the spell would be ruined anyways. (And I think that later statement is RAW, but I am far from my books and can't check to be sure).