We have horses and this is what we have done. We have a white bucket, and regularly we put some grain in the bucket, go to each horse, and "treat" them out of the bucket (our horses are not handfed and rarely get treats). The result of this is that if they get out of the pasture or corral, we get the white bucket, get their attention, and back they come.
On spooking when being ridden: this is another type of problem. Be calm, first of all. Your horse will instinctively know if you are as upset as they are. Depending upon the horse and where this happens: if you have the confidence of the horse (and it is a nice, trained horse), you can stand near them, talking all the while, then slowly walk up to them (slightly to the side--you don't want to be in front if they spook again). I would gently throw the end of a lead rope over its neck, and for our horses, that means they are "caught" and they will not fight at that point. Or, if there are dropped reins, pick up one of the reins and try to gently lead them. Talk to them!
Spooked can mean so many different types of situations with so many types of horses and levels of training. We have one horse that spooks at loud noises. She goes straight up in the air, usually unseats a young rider, and goes about 20 feet and stops. At that point, she is very penitent, and so far, no one has been hurt.
If I were you, I would train the horse to a dropped rein (ground tied), a white bucket with grain, a lead over their neck, and just generally work on trust. Also, look at what is spooking them: can you avoid the situation?
Enough--contact me if you have questions. This is like 20 years of horse in 100 words or less. Hope it helps, and good luck!