You're lucky that's for sure.
Try to kill the electric power first, then smother it if you can't do that. Extinguisher is good as long as the power doesn't keep feeding into whatever is burning, and water - uh its Ok once the source is off but if not that's when you got to have a serious fire hose - like on carried on a fire truck! I can't recall what they said in that class, 3" , 5" I don't remember - bigger than anything I have access too.