If your horse is experiencing pain, first, move him to soft bedding, like sawdust, or at least the softest ground you have and make him comfortable. Give him some grass hay if he's willing to eat, and make sure water is available.
Then call the vet. You may consider soaking his feet in cold water if he's standing and will let you place his feet in buckets or rubber pans to do so. Let him lay down if he wants.A very small dose of bute may help, as well, but only for the next couple of days, and ONLY if he's in excruciating pain. If you mask pain, he may move more than his feet can handle and do more damage. Have a farrier come out to trim excess wall away ASAP to minimize damage within the hooves. The most painful, Acute stage, lasts about 72 hours. After that, make sure your horse can move around IF he wants to. Don't confine him in a stall after the acute stage! And don't starve him. If he gets grain, he can still have SOME, if you suddenly cease to feed his usual feed, it can cuase more digestive upset, esp. if it wasn't triggered by feed.
Once he's out of the Acute stage, turn hoim out 24/7. SPread his hay around so he'll move some, (at his own speed). Handwalking for a few minutes a day will help start the recovery, avoid super hard, choppy/rocky ground for a while, just nice, firm ground, like a rubber mat. But don't force excerise the first 3 days!!! Have the farrier out in another 2 weeks to trim again, to keep the damage in check, and again in 3 weeks, then 4, and keep handwalking. Avoid sharp turns initially, as they can cause damage, as well, by tearing at the internal structures.
Absolutely don't give bute after the first 3 days. DOn't rush him when you handwalk him, and reconsider what diet you feed him and figure out what caused the episode in the first place. Bad shoeing? Feed? Sugary grass? Too much work suddenly on a very hard surface?