With the scores level at 1-1 in Bordeaux on Tuesday, Ramos surprisingly stepped up to take the spot kick in the 72nd minute after David Silva was deemed to have been fouled.
Modric is Ramos' team-mate at Real Madrid and, as a result, is familiar with the defender's penalty-taking routine.
Srna ran across to the sidelines, where Modric was sat due to being injured for the decisive Group D game, and was given details to tell Croatia goalkeeper Danijel Subasic.
Srna whispered in the ear of Subasic, who smirked, and promptly refrained from diving as Ramos slowed before he struck the ball straight at the shot-stopper.
Ramos' penalty miss proved to be extremely costly - Ivan Perisic scored a late winner to condemn Spain to second place in their group.
And all thanks to Modric's secret message!