If a horse starts eating soil, then it is either because he is starving - ie there is no grass, or not of a quality that he can get anything out of - your dry sun bleached grass for example, or he is lacking in some vital mineral or vitamin in his diet.
I suggest that you urgently collect a fresh poo sample and send it off to the lab to get it analysed since it can tell a lot about what is present and what is missing in a horse;s diet.
The reason why they might have stopped eating hay is the quality of the hay itself. It could be dusty, have mould spores, etc and not taste nice. And hay has no nutritional value at all, so they could well be starving and lacking something else in their diet.
When you get the results back from the samples then you can start adjusting their hard feed accordingly - you will need to talk to the feed merchant about this - and remember, do not make sudden changes. You might have to feed supplements to replace vitamins and minerals.
Also make sure that they have access to clean, fresh water 24/7, 365 days a year .....