Nothing beats "getting it right in the camera". But if the exposure isn't perfect, a lot can still be achieved.
Step 1:
My friend snapped this shot of yours truly at a viewing deck on the Gold Coast. Unfortunately the flash didn't fire, but I wanted to save the photo for my collection anyway.

Step 2:
The trouble is, if I lighten the photo uniformly, I lose the fantastic view. So I need to be a little more clever.

Step 3:
First, I select the foreground ...

Step 4:
... and lighten it. It's not perfect yet, but it's a good start.

Step 5:
Then I invert the selection, so I can boost the colours of the view.

Step 6:
Time to get down to details. I select myself ...

Step 7:
... and enhance various areas. I add more colour to the skintone, lighten the shirt a little more, and balance the light and shadow areas as necessary.

Step 8:
A few more little adjustments, and some sharpening, and I'm done.
Roll mouse over to compare original to final:
If you have a question about this method, or any Photoshop question, please visit me at my "Ask Damien" Facebook page.
All content © Damien Symonds 2012