I dont have the game but I think you have to battle the Boss pokemon.
he is at the top of team aqua HQ, after you beat him you get the master ball
beat their boss in slaterport
In Lilycove city, travel east and surf a bit, you will get to Team Aqua's base. Defeat the boss and you will get a scene.
every where team aqua is or in snoop dogs house.
Just go to the hide out of team magma then fight the boss then go to lilicove city then go to the cave to the upper part where the 3 wailmer is there then surf and fight the boss of team aqua the the 3 wailmers disappeared after u fought the leader of team aqua.
The Team Aqua boss is in the Team Aqua Hideout northeast of Lilycove City. You will need the HM move Surf to reach the hideout.
you beat the boss
You get a master ball either from your cheats if you have any or else you get a master ball from the boss of team galactic (cyrus when you beat him in head quarters).(This answer is for Pokemon Diamond and Pearl).
you go to sootopolis city and than talk to Wallace the gym leader of sootopolis to go to the cave of origin to catch kyogre!
You beat the boss in a battle and he will give you one or the guy you saved will.
Go to team aqua HQ. Go to the bosses room. There you will talk to him. The boss is kinda nice and I would rute for team aqua if I were you. Know exit the HQ. Save the master ball to capture Raquaza. Do not waste it on Kyoger or Groudon. Catch those Pokemon with ultra balls. Hope this helped. Jey Jey out.
Actually that only works on regular pokemon if the boss pad is shiny its a legendary you automatically get it once you beat it a regular boss you get lucky