Basically, as I understand it (and I could definitely be wrong), a "spot foul" depends on where the ball ends up compared with where the foul occurred.
So on a return, for instance, if a spot foul happens ahead of where the ball ends up being downed, then the penalty yards are marked off from where the ball is downed. So for instance, if on a kickoff return the foul occurs at the 20 yard line, but the runner only makes it out to the 15, then the yards are walked off from the 15 (the farthest the ball advanced).
On the flip side, if the ball is downed ahead of where the spot foul occurs, then the yards are marked off from where the penalty occurred. So for instance, if the foul occurs at the 20 yard line, but the returner makes it all the way out to the 30, then the yards are walked off from the 20 (where the foul occurred).
That, I believe, is what a spot foul is.