good luck.
There was an article year or so ago in Horse and Rider, I think, about what to do if your horse steps on a nail. To late for you now. If I recall though, the reccomend, if you have to pull it out take a marker and mark on the hoof exactly where it was, mark on the nail how far in it went and if possible note the angle it went in at. Ideally you leave the nail and let the vet remove, but sometimes that isn't possible depending on how far in it went.
Good luck hope he is OK.