In Team Aqua's hideout (east of Lilycove), there are four balls. The top left is the Master Ball. The others are 2 Electrodes, and 1 nugget. This vid may help you on how to get to that area in the hideout.
Another way to get a Master Ball is in the Lilycove department store lottery corner. If one of your Pokemon's OT (original trainer) IDs match the 5 digit number picked in the lottery, you get a Master Ball.