Its simple enough. Put the text layer below the background one. Now ctrl click
between the two layers. (the intersection) and voila you got it.
Now for the border part right click the text layer and select "blending options". choose
stroke, change position to
outside and rest all as per the taste.
The difference between this version and that by chanda-mama

is that you don't lose any original details. You can change the text anytime you want etc.

Screenies:

The original image

and layers

Layers after
ctrl click

resultant image

Adding a
stroke

End result
-seXie