The Two Lovers filmmaker was due to attend the prestigious event to present a retrospective about American film noir alongside Last Man Standing director Walter Hill.
But Gray has been forced to cancel his visit after falling ill.
He says in a statement, “I am sorry to inform all of you that I will not be able to attend the San Sebastian Film Festival this year due to illness. I am profoundly disappointed.
“It has always been a dream of mine to participate in this great festival, and although it appears I have lost my chance this time, I shall not wait long to make amends. I am grateful for your understanding.”