My friend is in Spain on a student visa who is an Indian citizen. His visa is going to expire on 27-05-2018, he wants to travel India on 23-05-2018 and go back to Spain in 10 days. He has already applied for visa extension can he travel to India and go back to Spain?
For this to work, your friend needs the "visa extension" to be approved and the appropriate document to be issued (whether a passport sticker or residence permit card) before travel. If your friend has to leave before receiving the document, it will be necessary to get a new visa from a Spanish consulate in India before returning to Spain.