Well if rayquaza breaks up kyogre and groudon then why does he have the cheek to fight with deoxys
It fights Deoxys because it believes that Deoxys is invading it's territory which is the atmosphere,but at the end of the movie it realizes that Deoxys is searching for it's friend so it stops attacking Deoxys