How do you catch Rayquaza?
Put him to sleep or freeze him, then weaken him down to the point where you can barely see the red and catch him with an Ultra Ball or another high end PokeBall.
The best idea is to use a move like False Swipe so you're 100% sure he has one HP afterwards. Then you can put him to sleep or freeze him. After that you should use a Great Ball or Ultra Ball and press B up when the pokeball opens. (Sometimes this helps catch a Pokemon)
Use Mareep or any other Electric and/or poison type to paralyze him and then use Cotton Spore. You can then lower his health and attempt to catch him.
If you've already dealt with the scene at Sootopolis City then you can capture him. The way I did was to first find the master ball in team aqua's hideout at Lilycove City. Once you're at the top and start to battle with him do try and lower it's Hp (even though your going to use a master ball). Fire and Fighting types don't work very well so don't use Blaziken. Once you've lowered it's HP use the Master Ball and it will be yours.
The Master Ball will catch any Pokemon on the first go. However, Rayqaza does not require this as he can be caught with an Ultra Ball or lower powered ones. It is recommended to save your Master Ball for a Pokemon that cannot be caught with regular balls like Latios and Latias. Just paralyze him, and lower his health with moves, but be careful not to make him faint. You should use your Pokeballs and Great Balls first as this helps with capturing him. Then just use tons of Ultra Balls until he gets captured.
Raquaza will only appear at Sky Pillar.