True Seeing, that penultimate divination spell that foils dopplegangers, demons, dragons, illusions, and deceptions. It is the bane of DM deviousness. That doesn't stop me from having BBEGs use it against the PCs, though. What's good for the goose...
How To Foil True Seeing:
1. Unique spell: Anti-Magic Wall
2. Programmed Illusion: Have everything look like it actually is. PCs detect the illusion, use True Seeing... and everything is exactly the same. Now they start wondering how you fooled True Sight.
3. Mind Blank, depending on your rulings of how the spell works.
4. Hordes of duplicates of the item/person. Simulacrum, mass polymorph effects, and the like are great for this.
5. Mundane disguises are not penetrated/revealed by True Seeing.
6. Hide skill.
7. Magical Blindness.
8. Modified Ioun Stone: Detects and zaps anyone who uses True Sight within a 300' radius. That tells the archers who to focus their poisoned flaming shocking acidic sonic arrows on.
9. Wall of Force (blocks line of effect).
10. Wall of Iron/Stone/Ice.
11. Flesh to Stone. Drawback: It allows a save.
12. Prismatic wall/sphere.
13. A full company of Death Knights (make them actual Knights, from the PHBII, or Knight/Warlocks) following the PC in the ethereal, waiting to pounce on him when he detects them.
14. Invisible summoned creature following the caster around. Whenever he starts to cast/use an item with True Sight, hit with a targetted Greater Dispel. Creature's next action is to, hopefully, teleport away while everyone's suffering from surprise.
15. Curses. Lots of them. Along the lines of: True Seeing will still work, but some aspect of what is viewed will show up as false. For example: The farmer over by the butcher's shop appears, under True Seeing, as a balor.
16. Long-term spells: The potential target of the spell casts a unique spell on the PC. The spell sits until the PC casts/uses True Sight. Then the spell detonates, causing 1d4 hp/level (save for 1/2) in a 5' radius. Caster has to make a concentration check now. At the very least, the caster/item user has now drawn lots of attention to himself. "I cast True See-BOOM!!!" Make sure the spell is built according to the normal rules, and that the NPC has it in his/her spellbooks - for the PCs to find or hear about once they get wise to it.
17. National laws against using spells like this. Summoned elementals, epic spells, city magic items outline the caster/user with a brilliant, scintillating glow. A disembodied voice repeatedly announces, "Attention!! You have made illegal use of unauthorized divination magics! Remain where you are until the authorities arrive!" Don't you just love Lawful nations with a long history of powerful wizards and clerics?
18. A familiar with a ring of counterspells, a high Spellcraft skill, and a readied action.
19. Wish/Miracle: I Wish that all attempts to use True Seeing on me automatically fail. Very subject to DM interpretation.
20. The BBEG sends spies after the PCs, all equipped with True Sight, detect magic, analyze dweomer, and high Spellcraft skills. They are under orders and equipped to retreat (via teleport, gate, skills, etc.) if spotted. Then, after gathering up all the info available, follow up with assassins who are now outfitted and buffed against the PCs specifically, and attack in overwhelming numbers when the party is split, or someone goes off by their lonesome. Strongly recommend that you reserve this only for highly intelligent, high-level BBEGs -- the sort who are campaign-climax battles.
Hope this helps.