Variations of the superglue (ie. CA glue) and epoxy methods mentioned above that you can try (mostly applies to small colonies or frags of stony corals)...
Sometimes just a single blob of CA on the bottom of a frag doesn't cut it. If not, try starting with a small blob, dip in a container of water, another blob, dip, repeat. The glue will form a skin each time you dip it in the water. After you've repeated the process a couple of times you have several layers. When you put the frag underwater in your tank, press, rub (to break up the layers) and hold. This has worked well for me.
One variation of the epoxy method that I have not tried yet - put a small bit of the epoxy at the location where you want mount the frag. This makes a clean mounting area on that part of your rockwork. Then use the CA gel method described above - supposedly the CA bonds much better with the epoxy than it does to the live rock. The advantage here is you don't have to form the epoxy up around the base of your frag which can take quite a while to encrust over (the CA gets encrusted over much more quickly IME). You also may not need as much epoxy so it can be better concealed (not as unsightly).
Also, sometimes the epoxy doesn't stick well (you need to squish it into a crevice, etc. as David mentioned). Supposedly you can put a little CA gel on the epoxy ball and then mash it in place. I've never tried this method either, but supposedly it sticks better than just epoxy alone.
...just a few more ideas to throw into the mix... :wink: