Sahih Muslim
The Book Pertaining to the Remembrance of Allah, Supplication, Repentance and Seeking Forgiveness (Kitab Al-Dhikr)
Book Number: 035 / Hadith Number: 6584
Ibn Abbas reported that Allah's Messenger (may peace be upon him) used to supplicate (with these words) and he (uttered these words) at the time of trouble; the rest of the hadith is the same except with this difference that insted of saying:" The Lord of heaven and the earth," he said:" The Lord of the heaven and that of the earth."