@Eleganz
I'd be interested to know what the big brains think of dark matter and dark energy. Many of our cosmological models rely on the existences of these things and the seem rather as hoc to me.
Dark matter (like every other aspect of science) was introduced pretty much as an ad hoc fix for something, yes. In this case, we couldn't explain the spin of galaxies. If you just take into account the matter we can see (the glowy stuff - stars and nebulae), they spin so fast they ought to fly apart. So we had to posit either that there was a lot of mass that we couldn't see, to make the galaxies' gravity stronger so that they don't fly apart, or that we need to modify our theories of gravity.
Dark matter is that mass that we can't see. We quickly realised that it couldn't be normal matter, because we'd be able to see bits of it when it blocked out stars and things like that. So we proposed a new type of matter that doesn't interact with anything except gravitation. So far, so arbitrary. But if you feed that type of matter into cosmological models then you get different predictions for the form of fluctuations in the Cosmic Microwave Background - predictions that match what we see once we could do that. That's a pretty strong piece of evidence for dark matter. However, we've never detected a "dark matter particle" directly, despite some serious effort.
The other option is to modify gravity. MOND (MOdifed Newtonian Dynamics) is an almost embarassingly simple tweak to Newton's theory of gravity that is remarkably effective at predicting galaxy rotation curves. I think the basic model has been falsified now, but people keep adding new tweaks that address problems. However, no one has successfully made a MOND-like tweak to Einstein's theory of gravity, so such theories are currently total and utter failures for explaining anything larger than a galaxy.
So dark matter is currently the leading theory. Despite some reasonable criticism at small scale (galaxy sizes and below), it's made successful predictions and is the only game in town at large scales. The last chapter of this book has not been written, however.
Dark energy is a completely unrelated phenomenon, despite the name. If you look at the expansion history of the universe, our observations are very, very, very slightly different from any model containing only matter, dark matter, and radiation. Dark energy is what you have to add to patch that. I don't think we have a lot of evidence for it beyond that. As I understand it (and this is a bit beyond my pay grade) it kind of fits conceptually with quantum field theory's vacuum energy (which would be really interesting if true), but the numbers don't work. I'm not sure even the second chapter has been written of this book, let alone the last one.
As I noted in my first paragraph, all of science is ad hoc in some sense. But eventually we make testable predictions with our ad hoc hypotheses and then we gain (or lose) confidence in them. Both dark matter and dark energy are needed to explain observations if you trust our theory of gravity - and that's incredibly well tested, so both ideas get a degree of respectability "out of the box". And I'd say that dark matter has a few predictive successes under its belt - dark energy not so much. Time will tell.