Optimize RAW files twice—once for highlights and once for shadows—for a better tonal range
Photographs coming straight from the camera often miss the tonal or brightness detail of a scene. Simply put, no existing, readily available photographic-capture technology can handle the extremes of light and dark that many scenes have.
In addition, the camera and sensor will often see the dark and bright areas of a scene differently than our eyes do, both in terms of tonality and color. A camera interprets a scene based on algorithms designed by the camera engineers. That interpretation may be perfect for your purposes, or it may miss what you think is important about the scene.
A Different Process
A great answer to this is to process a RAW file twice, once to optimize the highlights, then again to emphasize the shadows, and afterward, you combine these two processed files in your image processor. You can use any RAW converter to do the RAW processing, then any image processor to combine the files, as long as it has layers. For the example here, I'm using Adobe Camera Raw for conversion and Adobe Photoshop for the combination.
It's true that you can do all sorts of fancy things in Photoshop to try to duplicate this technique. You might try elaborate adjustments to the Tone Curve in Camera Raw, you might try Shadow/Highlight in Photoshop or even layers with multiple blending modes, as well as color and tonal adjustments. This sort of work isn't particularly intuitive to the photographer, and it often leads to a compromise, since getting the best from a highlight may change how a shadow is affected.
Double-processing lets you focus specifically on the important tonalities and colors and then process them so they look their best without compromise. The key is to ignore what's happening to the rest of the photo as you "develop" the specific tones and colors that you want to favor.
RAW offers a lot of power in making strong adjustments that favor only a certain type of tonality. In addition, if one of your versions of the image isn't quite right, it's easy to process the photo again because Camera Raw remembers the last conversion settings. You simply change those settings and reconvert the file (the original RAW file is never changed).
Analyzing The File
The image seen here is a strongly backlit, newer building on the campus of Cal State Stanislaus in Turlock, Calif. The sun flare is dramatic and the sky has potential, but the photo is hard to process in one step.
The exposure is exactly right for the scene—there's enough exposure to allow the shadows to be revealed, yet the exposure keeps color in the sky and doesn't blow out or overexpose the flare more than necessary.
The straight image made with little processing looks "okay," but it doesn't have a feel for the location that was part of the experience of being there. In part, the shadows are a little flat and too blue, but if those problems are corrected, the sky dies.
A digression: The sun flare seen here can be created with any lens by stopping down to one of the smallest ƒ-stops, such as ƒ/16 (though this will depend on the lens), then exposing so the light shows up against its surroundings. This flare comes from the light diffracting through the small aperture of your ƒ-stop. It will look different with every lens, but it's always an easy way of adding drama to a backlit scene.