If you're a 3rd edition-style PC, you get to make a Swim check. If you fail, you take 20d6 damage. If you succeed, you take half damage and Swim out of the lava.
Don't forget about massive damage. If you take 50 points or more of damage, you have to make a DC 15 Fortitude save or die regardless of hit points.
Last edited: