"إذا مر بالنطفة اثنتان وأربعون ليلة بعث الله إليها ملكا فصورها وخلق سمعها وبصرها وجلدها ولحمها وعظامها، ثم قال: يا رب أذكر أم أنثى؟ فيقضي ربك ما شاء ويكتب الملك، ثم ¤ يقول: يا رب أجله فيقول ربك ما شاء ويكتب الملك ثم يقول: يا رب رزقه فيقضي ربك ما شاء ويكتب الملك ثم يخرج الملك بالصحيفة في يده فلا يزيد على أمر ولا ينقص"
The Prophet (peace and blessings be upon him) said:
"When forty-two nights have passed over the drop of fluid (after its settling in the mother's womb), Allah Almighty sends an angel to it who shapes it and creates its hearing, its sight, its skin, its flesh and its bones. Then he says: 'O my Lord, will it be male or female?' And your Lord decrees what He wills, and the angel writes it down. Then he says: 'O my Lord, what is its term of life?' And your Lord says what He wills, and the angel writes it down. Then he says: 'O my Lord, what is its provision?' And your Lord decrees what He wills, and the angel writes it down. Then the angel goes out with the scroll (the record of destiny) in his hand, and he neither adds to the command nor takes anything away from it."
Hadith Referenceصحیح الجامع الصغیر / حرف الألف / 797