logarithms and exponents are inverse operations, like addition and subtraction or multiplication and division, they undo each other. So, taking the natural log of both sides of the equation when one side is e^x just leaves x on that side (or taking the common log if it was 10^x). Example: 32 = 8e^x - first divide both side by 8, leaving 4 = e^x - next take the ln of both sides because ln and e^x are inverses. ln4 = ln(e^x) = x, so x = 4.
edit - that should be x = ln 4, not x = 4, sorry about that!