You need shoot raw to retain more information in the file. Else must use tripod and bracket your exposures. It all depends on the dynamic range of the camera you are using.
copied from the link. It is working what...
The Layer Mask
This is the easiest manual technique. Starting with having done the pasting of the dark image on the light one, add a Layer Mask. This is done by clicking on the second icon on the lower left of the Layers palette. You will now see a white rectangle next to the image on the Layer 1 layer. (See Figure #2).
Click on the background layer on the palette and the press CTRL-A to select the whole image. Press CTRL-C, copying it to the clipboard. Now hold down the ALT key (Option on the Mac) and click on the white mask rectangle on the Layer 1 palette.
The whole image will now turn white. Next, press CTRL-V to paste the contents of the clipboard onto the white mask. You will now see a B&W mask image. With the B&W mask displayed go to Filter / Blur / Gaussian Blur and set the Radius to about 40 pixels. Click on the Background Layer and you're done. (Thanks to George DeWolfe of CameraArt's magazine for bringing this technique to my attention.)
Oh yes. With this technique you may want to select the background layer and add an appropriate curve to brighten up the dark area a bit prior to flattening the layers.
for HDR you need to bracket your shots. take with different shots with different settings to gain different exposures before merging them in HDR. photomatix allow the use of another setting, not HDR to properly expose images.
try reading around some articles on the net. you don't need to shoot in raw to do HDR.