Heavy support Carnifexes (the most common type) typically have a toughness of 7 and a 2+ armor save. Elite carnifexes have a toughness of 6 and a 3+ armor save. Both varieties usually have 4 wounds (the nid player can buy another wound and the ability to regenerate wounds, but this isn't usually worth it). So weapons that deal with carnifexes well are ones that can deal with their high toughness and great armor reliably. Melee carnifexes are somewhat rare as they're usually very inefficient (an assault unit that has a 6" move only and has a big target painted on it). If they're taken as elites you're more likely to see meleefexes due to point constraints but then they've only got a 3+ save and can reliably be killed with high volume str 6 or 7 fire while the heavier weaponry is trained on the heavy support carnifexes. Heavy support carnifexes usually come in one of two basic setups: sniperfex and dakkafex with sniperfex being the most common. Sniperfexes have a BS of 3, a venom cannon (str 10 ap 4 assault 2 36" cannot get a penetrating hit on vehicles unless open topped), and a barbed strangler (str 8, ap 5, assault 1 large blast 36"). This variant is for tank hunting and is fairly good at its role, though somewhat unreliable with its bs of 3. The dakkafex is an infantry hunter. It wields 2 twin-linked devourers giving it 8 str 6 ap - shots at 18" approximately 6 of which will hit and since it uses the living ammo special rule it gets to reroll to wound all 6 of those str 6 hits.
Anti-tank fire with ap 2 or 1, rending, and pathfinders are great for taking them down at a range, though it will take them a bit. Carnifexes can only ever move 6" so they'll have plenty of time to work on it. The most efficient way to take down any carnifex is to kill it with a powerfist in a big squad (preferably something cheap like ork boyz). Carnifex kills some expendable models, then the powerfist reams the Carnifex. May take a few rounds but it's worth it. Tyranid players do not like to send their fexes into melee with powerfists.
Force weapons are a gamble since they need a 6+ to wound. A typical character with one is going to have about 5 attacks and will have a 56% chance of inflicting a wound and will almost certainly die to the carnifex's attacks back. A chaos lord with a blissgiver (instant death from any wound) who rolls well has a slightly better shot at killing the beast, as does a chaos lord with the nurgle daemon weapon for the same reason that a DE character with an agonizer has a good shot (always 4+ to wound power attacks). Again, they need to worry about getting all 4 wounds in one go or risk instant death from counter assault (less of a problem for the DE with shadowfield). So, special characters have some interesting options but all have problems with getting instant deathed in return.
There are special characters that have a better shot, but taking a special character to counter a specific foe is kind of cheesy.
The really scary tyranid MC IMO is the hive tyrant. A winged hive tyrant with 2 twil-linked devourers and the right upgrades is spitting out 12 str 5 ap - shots at bs 4 that gets to reroll hits and wounds. It can move 12" and fire 18", is still a very capable melee combatant (and can kill tanks in melee), and has a 2+ save with 4 wounds. It's even very affordable at 196 points. You can also kit out a hive tyrant for CC but they still run into problems with powerfists.