That wasn't a bad play or a bad beat. Pre flop when he calls your raise I would have put him on 2 over cards, may be Ace Queen. After the flop when he calls your raise I would have put him on a high pocket pair maybe Jacks, or maybe big slick and he is going to try to out draw you. I can't see how you could have put him on pocket 10's and avoided losing chips. Are you going to flop a set and then fold it because he may have flopped a bigger set ? I would have had to pay him off.

* I usually don't like to raise big pre flop with small pocket pairs. I like to limp and hope to catch my set.