Running into trips is one of the worst things, you often can't defend against it because they are a silent killer. Usually the more aggressive you are as play style the more you end up surrendering to trips if at the same time you happen to flop a good hand. I can tell you that twice it has happened to me to flop 2 pair while opponenert flops trips, another time I flopped trips and opponent flopped a better set! I obviously ended doubling him up in all those hands.
There are times when you can suspect trips, but this extremely rarely happens after the flop. As has been said many times holdem is a game of incomplete information, and any time you attempt to put your opponent on a specific hand you are almost certainly making a mistake. What is correct to do is put him on a range of hands, and at every move he makes you add info to try to shrink this range.
What I'm trying to get to here is that while you always want to stay alert against sets, if you find yourself too often putting your opponent on trips there is something wrong with the way you try to read hands. Trips are very hard to come by, and putting your opponent on 1 is very difficult. I can't tell you the exact percentage of times someone flops trips because I don't know it, but I do know it is very low. Just think when you are dealt a PP you will flop trips less than 12% of times.
Now, as to your question "how do you avoid losing alot of chips when you run into trips?", I wish I knew the answer to that. I think it's very hard to do, probably impossible against some opponents, when you hit strongly with the board like making 2 pairs. Other times, which I'm sure has happened, you end up folding to trips without even knowing your opponent has them, since many times by the way the betting goes and knowing what type of player he is you understand you're beat even if you have top pair with top kicker. This, I think, is the way to go; understanding when you're beat, without necessarily putting him on trips.