It depends on what it is, specifically.
Fire spells will work nicely against zombies or mummies, but will have a harder time affecting incorporeal undead.
Command undead works wonders against even thr toughest mindless undead, but isn't likely to succeed against any intelligent undead with a reasonable Will save.
Summoned monsters may be useful against undead with ordinary vulnerabilities, but will have a hard time against anything with damage reduction.