Its attack is useless if either one of you is blind, so the easiest solution is to wear a blindfold, then treat it like any other monster. Another good practice when encountering fire using monsters or traps to conserve your scrolls, potions and spellbooks is to keep these types of items in some kind of container, like a sack or bag of holding, or on the ground if lacking such tools and desperate. Having fire resistance prevents damage but can still affect your items. A pyrolisk corpse is a good source of both fire and poison resistance, with no risk of poisoning when consuming it.

At first glance around the corner, I thought it was another
cockatrice. I had encountered the wretched creatures two or
three times since leaving the open area. I quickly ducked my
head back and considered what to do next. My heart had begun
to thump audibly as I patted my pack to make sure I still had
the dead lizards at close reach. A check of my attire showed
no obvious holes or damage. I had to keep moving. One deep
breath, and a count of three, two, one, and around the corner
I bolted. But it was no cockatrice! I felt a sudden intense
searing of the skin around my face, and flames began to leap
from my pack. I tossed it to the ground, and quickly retreated
back, around that corner, desperately striving to get out of
its sight.