Is there an easy way to get out of a cave?
I fell into the same trap and literally gave up. The easiest way to get out is to simply reload your save. The Waypoints and your ship are save points. If you choose one of them from the pause menu you will be transported out of the cave (and back in time). I don't go in caves anymore.
You might also be able to grenade your way out but I have had mixed results with what terrain actually blows up and how many grenades you would need because you have no way of knowing how deep you are.
I've gotten lost in caves so frequently that I have stopped trying to find the "actual" exit. Instead I just point towards my ship on the compass and tunnel out with grenades. There's almost always Pu (or at least C) in cave systems (unless you yourself have created the cave system :), so you shouldn't run out of grenade fuel.
As an aside I must say that I find the grenade-tunneling to be the most enjoyable aspect of the game. (It reminds me of the Tok'ra tunnels from Stargate.) Nothing beats claustrophobia like the ability to destroy one's immediate surroundings!
Pro Tip: Equip the grenade radius upgrades and all the JetPack upgrades you can.