How do I catch Rayquaza in Pokémon Sapphire?
Solution 1:
I would recommend bringing a Pokemon that can paralyze or put Rayquaza to sleep. Moves like Thunder Wave or Hypnosis come to mind. These will increase your odds. (In addition, Rayquaza awakens from Rest after two turns while putting it to sleep yourself is likely to last longer, and Rest is a headache to contend with anyway.)
Besides that, you're pretty much doing as much as you can, so keep throwing Ultra Balls and hope for the best.