??? is the type of the move "Curse" which affects non-Ghost type Pokémon differently from Ghost types, and an unused sprite of Arceus. It started in Generation II but as of Generation V, Curse has been reclassed to a Ghost type move and the type has been retired.
In Generation IV, if a pure Flying type uses the move Roost, it will be turned into ??? type for the rest of the turn. However, since there were none until Generation V, the Pokémon must have the ability Color Change or use Conversion to change into a Flying type.