For Schengen visa, the application must be submitted to the embassy or consulate of the Schengen state you intend to visit. Even if the intention is to spend equal length of time in several Schengen states, the application is to be submitted to the state that you will arrive in first.
The visa application must be submitted at least 15 working days before the intended visit. In general, an application cannot be submitted more than 3 months before departure. Visit the following website to apply for the visa: http://www.exteriores.gob.es/Embajadas/NUEVADELHI/en/Pages/inicio.aspx. For most visas, applications can be completed online, though for some applications, the passport and other supporting documents must be sent to the immigration authorities.
Visit the above-mentioned website of the Indian Embassy in Spain for any emergency while in Spain. For any visa-related query, contact the Spain Embassy or consulates in India: