He committed zina during one of the nights of Ramadan and he wants to repent
Question

One of my friends had sex with a girl during one of the nights of Ramadan. He is single and is asking about the ruling and what he has to do.
Praise be to Allah.If what is meant is that he committed zina –Allah forbid – then zina is a major sin and a serious offence. Allah has warned us against it and stated that it leads to bad consequences. He says (interpretation of the meaning): 
“And come not near to unlawful sex. Verily, it is a Faahishah (i.e. anything that transgresses its limits: a great sin), and an evil way that leads one to hell unless Allah forgives him)” [al-Isra’ 17:32]
Allah has decreed that the punishment for the zaani is stoning, if he was married, and flogging if he was unmarried. That is because of the abhorrence of what he has engaged in of haram intimacy. Allah says (interpretation of the meaning): 
“The fornicatress and the fornicator, flog each of them with a hundred stripes. Let not pity withhold you in their case, in a punishment prescribed by Allah, if you believe in Allah and the Last Day. And let a party of the believers witness their punishment” [al-Noor 24:2]
But by the mercy of Allah, the door of repentance is always open, and Allah is Oft-Forgiving, Most-Merciful; He loves the repentance of His slaves and accepts it if he turns to Him. Allah says (interpretation of the meaning): 
“Know they not that Allah accepts repentance from His slaves and takes the Sadaqât (alms, charity), and that Allah Alone is the One Who forgives and accepts repentance, Most Merciful?” [al-Tawbah 9:104] 
“Allah accepts only the repentance of those who do evil in ignorance and foolishness and repent soon afterwards; it is they whom Allah will forgive and Allah is Ever All‑Knower, All‑Wise” [al-Nisa’ 4:17] 
“And those who invoke not any other ilaah (god) along with Allah, nor kill such person as Allah has forbidden, except for just cause, nor commit illegal sexual intercourse __ and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allah will change their sins into good deeds, and Allah is Oft‑Forgiving, Most Merciful” [al-Furqaan 25:68-70]
How forbearing is Allah, and how Generous. His goodness descends upon them even as their evil deeds ascend to Him. He holds out His Hand by night to accept the repentance of the one who sinned during the day, and He holds out His hand during the day to accept the repentance of the one who sinned at night. All the sinner has to do is acknowledge his sin and give it up, and ask his Lord for pardon and forgiveness, and resolve never to go back to that sin, and to set his deeds straight, and strive to do that which will please his Lord, may He be blessed and exalted. 
The one who does that will find relief, for the Most Gracious, Most Merciful rejoices over the repentance of His slave and accepts it from him, and He will reward him for it and erase his bad deeds thereby, and raise him in status, because He is the Forbearing, Most Generous, Most Kind, Most Merciful, may He be blessed and exalted. 
Allah says (interpretation of the meaning): 
“And verily, I am indeed forgiving to him who repents, believes (in My Oneness, and associates none in worship withMe) and does righteous good deeds, and then remains constant in doing them (till his death)”
[Ta-Ha 20:82]
Moreover, we say to this brother: beware of removing the cover with which Allah has concealed you and telling anyone of what you have done, because the Prophet (peace and blessings of Allah be upon him) said: “Avoid these filthy things that Allah has forbidden. Whoever has done any of them, let him conceal himself with the concealment of Allah, and let him repent to Allah.” Narrated by al-Bayhaqi; classed as saheeh by al-Albaani in Saheeh al-Jaami’ (149). 
Muslim (2590) narrated from Abu Hurayrah (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: “Allah does not conceal a person in this world but Allah will conceal him on the Day of Resurrection.” 
So hasten to repent and regret, and weep for your sin and wrongdoing. Conceal yourself with the concealment of Allah and do not speak openly of your sin;  do a lot of good deeds such as praying, giving charity, dhikr, and tasbeeh, for these are means of attaining forgiveness. 
Beware of procrastinating with regard to repentance, or of taking the forbearance and concealment of Allah for granted, for Allah may grant you time or He may not, and He may become angry and seek vengeance. Perhaps He will look at His slave who dares to disobey Him and will say: ‘Go, for I will never accept any good deed from you,’ so he will be utterly lost and his punishment will be Hell. We ask Allah to keep us safe and sound and to grant us salvation. 
We ask Allah to set the affairs of the Muslims straight, and to bring that back to the right path. 
And Allah knows best.