No one unit effectively counters the Imperial Knight. My usual counters consist of 1-2 XV104, 1-2 Helios XV8 teams and 1-2 either XV25 with 2x fusion or else a trio of missilesides. You have to attack from multiple angles - that's the only way to counter the ion shield. For Crisis/Stealth, you may have to stay outside of melta range in order to avoid the catastrophic destruction blast, but S8 can still destroy a knight effectively, with enough of it. Railsides might be an option - with their range they can start banging away turn 1, and with their 2+ armor, they might survive a battle cannon hit. That thermal cannon is still death, though, and the ion shield is a showstopper.
Hammerheads, or at least railheads, are a waste of energy IMHO. Too much chance for that one shot, even BS10 and Tank Hunters, to fail you when you need it most. The Skyray gets you six effective shots - once. Seems dubious to me, too.
One of them is not too hard to counter. But three to five? Ouch. That's "that guy" territory, for sure.
Here's something to try: deploy two Riptides front and center, one with the HBC and one with IA. Park 'em in cover or behind an Aegis line, if you have cover better than 5+ available (and if you have an Aegis line, consider taking the lascannon). Yep, the ion shield will probably point at them. That's the idea. Use whatever tricks you have available to reduce the danger from Gets Hot: if you're running FSE, O'Vesa and another cannontide with ECPA is a good way to go. If not, enough markerlights to hit BS6 is a start even if it doesn't reduce the threat from nova-charge failures. You'll want stims, too: you want the Riptides tanking as much of the return fire as possible. I suppose you could use R'Varnas here too, but I don't have any, so I haven't tried it.
Next, hit from both sides. Use Commander Shadowsun (in an allied det/secondary CAD, obviously, if your primary is FSE) to outflank in some Broadsides. Bring her CLD, some missile drones and maybe her MV52 shield drones. If she's close enough her fusion blasters are a threat too, but if she's not, don't sweat it. Her cover saves also help against the inevitable return fire, even blocking the thermal cannon potentially. Then Deep Strike some Sunforge or Helios XV8s on the other side or to the rear. Hopefully scatter isn't too cruel. If you have Farsight, drop him in here too - remember, he's faster than a Knight and has an Armorbane sword. He's got a shield generator, too, so with a little luck, he could survive a D-weapon hit. If you feel froggy, a commander with Fusion Blades is something to try. I honestly don't know how well it'd work, but it's worth trying with some shield drones.
Last but not least, you have some Fire Warriors, right? Had to take them, or Kroot, to go with your allied C:TE CAD. Give them EMP 'nades, and make them part of the trap. Then spring it. Fire away. Chuck a 'nade if you're in range (try to be). The ion shield can only go in one direction. Hopefully the fire coming in the other directions is enough to bring the beast down - don't forget they're AV12 on the sides and rear, so your fire from there will be more effective, and plasma rifles or CIBs might do something. If the mechanical monstrosity still isn't dead, charge with anything that can damage the armor: Farsight, Riptides, Fire Warriors or Pathfinders with EMP 'nades, Commanders with Fusion Blades or an Onager Gauntlet. Take your lumps from the chainsword and let the survivors swing back. Hopefully that will be enough.
Unfortunately, if you're facing That Guy, there's still four more to go...
There are a few other options - Allies! Obviously, all of these have to be used together with the rest of what Tau can bring, but they may provide the edge that you're missing.
Imperial Guard - Leman Russ squadrons. Three battle cannons and lascannons will at least force the ion shield to point that way; at that point Deep Strike behind with Crisis or Riptides.
Space Marines - Storm Raven! It flies, and with its AV, the Knight can't hurt it with the stubbers. Use its missiles, multi-melta and lascannon or assault cannons. Carry a dual-autocannon Dreadnought for good measure and plop it somewhere that forces the Knight to deal with antitank shooting from two sides. Devastators or a Predator are another option but they really aren't much better than Railsides.
Space Wolves - See Space Marines, but s/Raven/Fang/ and you'll have to do without the Dread, unless you just strap a Helfrost Cannon on one and lem it up the middle while the flyer brings a Helfrost Destructor from the side or rear. It could work but it's not much better than anything Tau can do alone.
Adepta Sororitas - Dominions. Outflank with meltas in an Immolator with - you guessed it - more meltas. Give the Sister Superior a combi-melta and melta bombs. Then pray that today, the Emperor really does protect when you roll your Shield of Faith against the exploding Knight. Well, nuts. Maybe don't do this. Sisters Repentia would also be a suicide squad, but flaming hilarious if it works.
Eldar - Wraithknight. Grab a Farseer as your required HQ for the chance at a witchfire with Haywire, and to twin-link your Wraithknight's shooting (and melee attacks, with Prescience). Forewarning and Fortune will be enough for a Wraithknight to melee down a Knight, if you're lucky enough to get them. Crimson Hunters, Shining Spears, Wraithguard and Fire Dragons are other options, as is the Falcon. If you're really feeling lucky, take Eldrad and try to get Fortune, Forewarning, Prescience and Eldritch Storm all on the same guy... (Don't do this. But if you do, and you luck out, well... Film it and giggle.)
Dark Eldar - Wytches with Haywire 'nades in a Raider as your required troops choice, an Archon with various bits of nastiness to back them up or a Haemonculus to keep it cheap, then a Ravager in Heavy Support.
Necrons - Warriors. Lots of Warriors. You have Gauss, use it. Repeatedly. With great relish. Giggle gleefully at That Guy while your wimpy metal skeletons disassemble his shiny toys one atom at a time. Then wonder what you're going to do with these footslogging metal skeletons... At least they're Allies of Convenience now.
Tyranids - Hive Tyrant. Make it fly, take Electroshock Grubs, two twin-linked brainleech devourers, and hope for Warp Blast. Then hope he left the anti-air at home. Fly around being a horrible pain in the neck. You could take a Hive Crone, too, if you have the points. Or take a Harridan and really make them cry. A Tyrannofex can hurt a Knight, but it's a crapshoot. Running a trio of Stonecrusher Carnifexes would be a good way to draw attention, too - the tactic's not called "distraction Carnifex" for nothing...
And that's just what I can think of, offhand. I'm sure Chaos and Orks have their own fun toys, too, I just don't know them well enough.