Recommended strategy for fighting Rayquaza is this:
Have Shedinja with these 4 moves:
Swords Dance
False Swipe
Protect
Silver Wind (any move here really)
Whenever Rayquaza uses Fly, use Protect. For any other move, you are immune to their effects. Use Swords Dance to boost your attack power, and then use False Swipe. Rayquaza will eventually be at 1 HP, but won't die. Chuck Ultra Balls until he's caught.