Before asking my question, I'll use an example to clarify the idea.
Say that a company used to sell horses and then they turn into a sheeps business. While some of the old pages can be mapped to the new pages using a 301 redirect, because they're really related in the content and the company don't want to lose users and link juice, there are a lot of pages strictly related to horses that they want to shutdown.
What's the best practice? Is there a way to say to users and Search Engines the content you were looking for won't be available any more?
Basically a 301 redirect of the closed pages to new ones seems not so good, because you'll show a content totally unrelated to the searched one.
P.S: I'm aware that probably the best fallback is to simply map those pages to the homepage but I hope in a smarter solution.