The three hunter talent trees, Beast Mastery, Marksmanship,and Survival, are all viable for raiding when used skillfully.
That said, hunters entering Karazhan generally deal substantially more damage with Beast Mastery than with other specs. Most hunters should spec Beast Mastery if they intend to raid Karazhan.
Beast Mastery Edit
Beast Mastery hunters do more damage because they shoot faster while their pets get large boosts to damage, all while using less mana. With the improvements to pets since version 2.0 of the game, the pets can survive in raid fights, and this makes all the difference. Also, with Ferocious Inspiration, the Beast Mastery hunter offers a damage bonus to everyone in his group, including casters.
There are still a few people who think that Beast Mastery hunters do less damage in raids, and who think that hunters should put their pets away in raids. Those people are trapped in Molten Core in 2006. Pets survive well in all fights in Karazhan.
To deal the most damage with Beast Mastery, take the damage-dealing talents in the Beast Mastery tree, up to The Beast Within. Take only 41 points, and include Improved Aspect of the Hawk, Improved Revive Pet, Animal Handler, and Serpent's Swiftness. Take only four of five points in Frenzy, as that is enough to keep it up most of the time.
Take 20 points in Marksmanship, to get Go for the Throat and Mortal Shots. Note that this means that you will not be able to take Hawk Eye, and you will be stuck with a 35 yard range. You also cannnot get Scatter Shot. This is fine for Karazhan. If you are the only hunter in your raid, take Improved Hunter's Mark. If there is another hunter that already has the skill, take Efficiency, instead.
Depending on personal preference, considerable variation in talent selection is possible while maintaining a viable raiding spec. When in doubt, though, the cookie cutter Beast Mastery build generally offers the maximum damage possible for Karazhan raiders.
Other specs Edit
The Markmanship talents offer good burst potential with high-damage shots, an aura that grants attack power to the group, and some nice utility.
The Survival talents offer good survivability, extra hit rating, excellent trapping utility, and a very nice debuff.
A special note about other specs: Even though other specs work well enough for Karazhan, this guide purposely avoids discussing them in much depth. Most raids new to Karazhan, especially once they get past the Opera event, benefit more from high damage output than from anything else a hunter can give them. That is easiest to get with Beast Mastery, so this guide focuses on Beast Mastery. Discussing the other builds would take a lot of work and add considerably to the length and complexity of the guide. Therefore, dear reader, if you feel that there really needs to be a discussion of other specs in Karazhan, just write it up in a separate guide! This page would be greatly improved by a link to another guide.