The game is not about random luck and misfortune, it just requires a notably higher player efficiency than most other games. You can not do things without having a clear idea WHY you are doing it. You can randomly jump to new points in a star system, not caring how soon you are going to end up at the exit, OR you can map everything out the moment you arrive in the system and make a plan A, knowing exactly where you intend to go to visit the maximum number of places in the system while being ready to alter the plan as opportunities and emergencies come about. Guess which strategy will help you win and which one will often be the reason you get overpowered eventually.
It is stuff like this that decides which player wins and which ones will die over and over again, not what loot and encounters you are randomly given. If you do not master the game mechanics and learn how to make every decision the most efficient one, you WILL die and the randomness is the least of your problems. You may have screwed up and doomed yourself by sector 3 but you won't actually die until sector 5 where your lack of efficiency has put you at such a disadvantage a chance encounter will appear massively overpowered.
Learn to analyse your failures. If you reach conclusions like "the game threw a difficult enemy at me" or "I was never given the tools I needed by the random number generator", you have no idea what you are doing while playing this game.
I have to disagree, to an extent. Like I said, I admit that the game is fun and addicitve (otherwise I wouldn't keep coming back to it), but there have been times I have done things just right only to be obliterated by sector 2 or 3, by random factors that never occured during ___ play through.
I am getting better at it over time, hence forth 'analysing my failures', even if it is at a subbliminal level.
Remember that the aim is to get to the mothership alive, while trying to be as powerful as possible by that point.
So there are times where the enemy just happens to have a loadout that kicks your ass? And you've gotten lots of scrap and just used it to buy awesome gear and fit your ship out? Well there are a few options:
1) Are you SURE you have made the right decisions up to this point? I'm talking where you spend your scrap - what weapons you buy, what systems you buy, what you upgrade? Remember that this, as you and others rightly say, is partially based on luck: where the shops are, what they sell. But also remember it's ultimately up to you and your choices, including how well you've gone up to then (although this last point is partially also down to luck, but not completely).
2) If 1) is not true, or even if it is - the fact could well be that your current setup isn't perfect for the current enemy. So, you need to get... creative. I won't go into it here - there are other posts that detail strategy already - but in summary: abuse pause, adjust your power constantly (e.g. when a missile heads towards you, shift power from life support and other systems (maybe even shields) to engines unless you have defense drone(s)), adjust your crew positions whenever something changes (fire, system damage, enemy boarders), adjust your doors/oxygen the same way, time your weapons fire for maximum effect, target the enemy systems for maximum effect (or minimise the biggest threat to you first - this could mean shooting engines before weapons if he keeps dodging your shots), use boarders judiciously (if you have them) as winning a ship intact greatly increases rewards.
If you do all of those things (and possibly more), so that your ship fights PERFECTLY, it's possible to beat more powerful/balanced enemies. It's sometimes not easy, but it's certainly possible - most of the time...
3) OK if the above didn't work (either due to lack of skill or due to the enemy happening to sneak a massive missile straight past your defense drone where it took out your massive mega super weapon of choice one micro-second before you were about to unleash hell on them), and things are going downhill fast (e.g. even with your damage control micro-managed things are still not going well), then it might be time to jam lots of power into the engines and hope they charge fast enough to GTFO with minimal damage.
Remember too that winning a battle with lots of hull damage - especially in the earlier sectors where the rewards are so crappy - might not be worth it. It's sometimes better to cut your losses and move on (and sometimes come back to that sector to finish the job if you're upgraded and it's convenient!).
That's just the way the game is supposed to be. This is especially true if you start with one of the more specialised ships, e.g. the Mantis ships. I've often had to go a number of sectors skipping fights because I encountered drone after drone and couldn't do anything about them - or conversely kicking ass for 5 sectors only to encounter that one crazy ship that totally counters what I have. Retreat sucks, but dying sucks more...