cbwjm
Seb-wejem
Sadly I think the main options are just thrown weapons or a back up bow. Fighters and barbarians might have to rely on thrown weapons if they are strength focused although even a +2 dexterity modifier will make them okay with a bow. The monk is probably high dex and they are proficient with simple weapons which includes the shortbow, might be worth them carrying one around as well.
Otherwise, the best way to help, I think, is to provide a way for the melee characters to be able to engage, you changed up the encounter to do so which sounds like it made for a memorable one, but for future you might want to have a way for them to cross that fiery magma and engage the bad guy and/or his minions without having to make changes on the fly. That or trust that the players will make choices that will help them engage. If a wizard commonly preps the fly spell then you might rely on them casting that on the melee PCs to allow them to get into melee range. You might also want to provide magical items that will help early on in the campaign. Give boots of flying at levels 5 or 6 so that they are available to (hopefully) one of the melee PCs for encounters like this one.
Otherwise, the best way to help, I think, is to provide a way for the melee characters to be able to engage, you changed up the encounter to do so which sounds like it made for a memorable one, but for future you might want to have a way for them to cross that fiery magma and engage the bad guy and/or his minions without having to make changes on the fly. That or trust that the players will make choices that will help them engage. If a wizard commonly preps the fly spell then you might rely on them casting that on the melee PCs to allow them to get into melee range. You might also want to provide magical items that will help early on in the campaign. Give boots of flying at levels 5 or 6 so that they are available to (hopefully) one of the melee PCs for encounters like this one.