Every exterminator has their own tricks of the trade, but the most effective bait for rat traps is normally considered to be peanut butter. Any sticky food works though.
This bait is good for rats whether you are using a kill trap or a live trap. However, bear in mind that some rats are omnivores and others are strict vegetarians. For example, black rats turn up their noses at bacon and most pet food, while Norway rats take just about anything a homeowner offers up or leaves sitting out. Make sure to identify the species being targeted before setting traps. In some cases, leaving traps that have not been set but have been baited improves the odds of catching the problem rodent once the traps have been set.