メアリーは宝くじに当たる夢を見た。

English Translation

Mary had a dream that she won the lottery.

Good for you, dreamy Mary!
宝くじに当たる is interchangeable with 宝くじに当選する(とうせんする).