I have won "third place" before. I think I matched the last two numbers. And yes, if you match them all, you get a Masterball. Here are some tips on how to win:
-Trade with as many people as possible. If you have extra copies of the game, trade over pokemon from those games.
-Reset your clock if you don't win, instead of waiting an entire week for the Lucky Number to reset. (Note: this only works on Silver/Gold, you cannot reset your clock on Crystal.)
-Or you can do what I did to win. You can just wait, then randomly win. I wasn't trying to win when I won third place
(By the way, I won a PP Up.)
In my opinion, though, the prizes are not worth it. You can duplicate Masterballs, Rare Candies, and all that stuff. If you'd REALLY like to win, try the tips I suggested.