A Schengen visa was issued to me by Greek Embassy valid from Aug 25, 2014 up to Oct 10, 2014. When my relative from Spain knew about it she sent me an invitation and asked if I can come earlier by Aug 12, 2014. What can I do?
Not much, I am afraid. Schengen visas can only be extended in very limited cases (basically if you can't leave or if you have serious personal reasons to stay longer). You could apply for another visa from Spain or have the Greek visa annulled and reissued with different dates but all this seems very complicated and uncertain. Even if that was possible, the time you have to get this sorted out is extremely short.
What you can in any case do is plan your trip a bit differently, perhaps leaving Greece earlier and going to Spain then or something like that. Your current Greek visa would still be valid for such a trip, as long as you do also go to Greece, see Can I travel to Spain using a Greek Schengen visa even if I don't want to stay in Greece at all?