I use Mail.app to get my GMail via IMAP. The official recommendations for using GMail this way suggest that I shouldn't let Mail automatically move messages it detects as junk -- because GMail already does most of the legwork for you. I tend to agree, but this is quite frustrating in terms of my other accounts, as this is an application-wide setting.
However, there is a solution! By adding a simple mail rule, you can continue to set "Move it to the junk mailbox" in Mail's preferences, but have Mail ignore messages in GMail that it thinks are spam. First, make sure that, in Mail's preferences on the Junk Mail tab, Filter junk mail before applying my rules is unticked. Without this, the rule won't be applied. Now, add a new rule that says:
If all of the following conditions are met:
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080611190241173