Well it is a tough thing to detect. The best way to put them on a set is to see what they did pre flop. If they limped in and a couple low cards come and they come out betting hard then you can be pretty sure they flopped a set. Somebody already made one good point, to see how they played their last set. Of course that is a moot point if you're playing online against a stranger.

If you're truly unsure, betting out is a way to get some informating, a nice sized bet will prevent you from potentially losing your whole stack. If somebody comes over the top on your raise then you muck your hand unless it's a known bluffer or an overly aggressive player.