At the end of each turn, each adjacent sleeping opponent takes damage equal to 1/8 of its maximum HP.
Bad Dreams inflicts damage after a Pokémon that is drowsy due to Yawn falls asleep (and thus inflicts damage to a Pokémon the same turn it falls asleep due to drowsiness). Bad Dreams applies after a Pokémon has the opportunity to be woken up by Hydration, Shed Skin, or Healer.
Spoiler warning: this article may contain major plot or ending details.
Pokémon Legends: Z-A
In Pokémon Legends: Z-A, Abilities do not occur in normal gameplay. However, during the Rogue Mega Evolution battle against Darkrai, drowsy Pokémon will take damage equal to 1/25 of their maximum HP every second. When Darkrai Rogue Mega Evolves in the second phase of the fight, the damage increases to 1/16 of maximum HP and occurs more frequently. Darkrai does not retain this effect when caught.
At the end of each turn, enemy Pokémon in the same room with a sleep-related status condition (other than Yawning) will receive 15 points of HP damage.
If a person or a Pokémon is asleep near Darkrai, it suffers from horrible nightmares that can be fatal if the sleeping person or Pokémon doesn't wake up in time. The Ability is active even if Darkrai is inside of a Poké Ball.