One of these "ways" (I think it's the wizard one, the one without switches in the side alcoves) can be solved easily. Enter the first fire on your way, backpedal once you get burned, and then run directly forward. The grate will open and close such a way you reach the opened grate in the end.
The second way (with the switches): Go around the wall to a side alcove (it does not matter, which one). Flip the switch there. Go back and continue around the wall to the second alcove. Flip the switch. Now, go around the wall to the exit, the grate will be open. You must avoid: (a) the central fire, and (b) the fires near the exit until you flip both switches.
You can heal in the alcoves. Especially, the way with switches will cost you about 30 HP per party member. Plan accordingly.