The move Fly is contained in HM02, a hidden machine. In "Pokémon Ruby," HM02 is located on Route 119 between Mauville City and Fortree City.
HM02 is given to the player as a prize for defeating his rival in the third battle. The player's rival has the second-stage form of the starter Pokémon that the player's starter is weak against, as well as two other Pokémon of the other starting types, which can be either Shroomish, Wailmer or Numel. In order to use the Fly move outside of battle, the player must obtain the Feather Badge from Winona, the Fortree City gym leader.