Al-Kāfi - Volume 3 > Salah (prayer) for Istikharah (asking Allah to Choose for One What Is Good)
Hadith #4

4ـ مُحَمَّدُ بْنُ يَحْيَى عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ عَنِ ابْنِ فَضَّالٍ قَالَ سَأَلَ الْحَسَنُ بْنُ الْجَهْمِ أَبَا الْحَسَنِ (عَلَيْهِ الْسَّلام) لابْنِ أَسْبَاطٍ فَقَالَ مَا تَرَى لَهُ وَابْنُ أَسْبَاطٍ حَاضِرٌ وَنَحْنُ جَمِيعاً يَرْكَبُ الْبَرَّ أَوِ الْبَحْرَ إِلَى مِصْرَ فَأَخْبَرَهُ بِخَيْرِ طَرِيقِ الْبَرِّ فَقَالَ الْبَرُّ وَائْتِ الْمَسْجِدَ فِي غَيْرِ وَقْتِ صَلاَةِ الْفَرِيضَةِ فَصَلِّ رَكْعَتَيْنِ وَاسْتَخِرِ الله مِائَةَ مَرَّةٍ ثُمَّ انْظُرْ أَيُّ شَيْ‏ءٍ يَقَعُ فِي قَلْبِكَ فَاعْمَلْ بِهِ وَقَالَ لَهُ الْحَسَنُ الْبَرُّ أَحَبُّ إِلَيَّ لَهُ قَالَ وَإِلَيَّ.

4. Muhammad ibn Yahya has narrated from Ahmad ibn Muhammad from ibn Faddal who has said the following: “Al-Hassan ibn Jahm asked abu al-Hassan, ‘Alayhi al-Salam, for ibn Asbat; ibn Asbat and we all were present. ‘Should he travel by land or by sea to Egypt? Please tell him about the best road by land.’ The Imam said, ‘By land, but go to the Masjid in a time other than that for obligatory Salah (prayer). Perform two Rak‘at Salah (prayer) and ask Allah, one hundred times, to choose for you the best. Then see what comes in your mind, then act accordingly.’ Al-Hassan then said, ‘By land is what I like for him.’ The Imam said, ‘I also like for him by land.’”