When you miss the board and your opponent is calling you all the way to the river, you’re beat. The only way to get them off the hand is to bluff them. If they’re on a small pair, they’re already accustomed to the idea that there’s likely to be overcards that could make their hand worthless if their villain pairs one of them. So getting them to fold can be pretty difficult, and you might just give away all your chips to them trying.
The joy of winning with small pairs is the surprise factor, and the knowledge that your opponent now has that you can play a risky hand like that and not get scared into folding, so when they come after you again the next time, they better not be bluffing. Take away an opponent’s bluffs, and they become a much weaker opponent.
Of course the flip side of that is that they know they can get you to call thin, and may use that knowledge to exploit you the next time when they have something. So maybe change your game up after a hand like this, to really bamboozle them.
If the board missed them, but came in low enough that it’s likely the preflop raiser doesn’t have anything in their range, I’d say look for a better hand, and get out of it cheap. If there’s something high, but it missed you both, you may be able to get them to fold if you bet like it hit you, but you may then end up running into hands where you missed but that high card hit them (when they’re on a weak suited broadway, not on a little pair.)
If they get to the river and still haven’t hit a set, you may be able to get them to fold with a strong bet, but only if you haven’t already committed them. So try sizing your bets so that you’re going for a big value bet on the river, for most of their chips, but leading up to it the bets are small enough so that the final street bet is giving them bad pot odds and you a lot of fold equity. This can work especially well if the river card is painted.
But generally it’s better to just straight-up beat them with a better hand. I know, I know.