According to Jewish Law, human life is normally considered to be of prime value, so that it overrules all other laws and considerations.

Leviticus 18:5

You shall keep My decrees and My laws that a person will do and live by them - I am GOD

The Rabbis interpret this as a metaprinciple of the Torah, using it as their proof-text that the commandments should never cause the performer to die, as seen below:

Babylonian Talmud, Sanhedrin 74a

"And [you shall] live by them" (lev 18:5) not die by them.

In fact, in cases where someone's life is in danger, halacha (Jewish law) says people are obligated to, say, desecrate Shabbat to call an ambulance even if it's possible to get the hurt person to the hospital anyway. Some sources say the one who stops to ask a Rabbi's opinion in such circumstances - rather than just getting on with it - is guilty of murder.

So that's the general rule. Sick people are exempt from fasting on Yom Kippur, hurt people can be rushed to hospital even if it violates Shabbat, life-saving medicine can be made of pork and lobsters. Presumably, if it literally was life-or-death, you could steal food to eat. End of story.

Well, not quite. This rule would actually create a number of legal anomolies in certain circumstances. For example, what if a gunman tells you to steal something, or he'll shoot you? Or to beat someone up? Or even to commit another murder?

Babylonian Talmud, Sanhedrin 74a

Rabbi Yonatan said in the name of Rabbi Shimon son of Yehozadak what they discussed and voted on in Nitza's attic, in Lod:

"For all the transgressions in the Torah, if a person is told "transgress or be killed", he should transgress and not be killed, with the exception of idol worship , sexual immorality and murder."

Yes, Judaism has its deadly sins too, and they're more hardcore than avarice and gluttony. Murder is worse than pride, whichever way you cut it. And all three, in this scenario at least, are actually deadly.

Interesting here is the way these three sins are picked. Idolatry is an easy one; they have a Torah verse: "And you shall love GOD, your God with all your heart and all your self and all your means" (Deu 6:5). The Talmud interprets "all your self" to mean a Jew should be willing to lay down her life for God and not deny her religion.

For sexual immorality, the Talmud looks at the laws in the case of rape (which is taken as the epitome of sexual immorality). There we find the following comment in the Torah: " when a man rises against his brother to kill him, so is this [rape]" (Deu 22:26). From this they deduce that the laws of rape and murder are linked, and that if you can't murder to save your life you can't rape either.

So how do we know that you shouldn't murder somebody if your life is threatened?

Babylonian Talmud, op cit.

And how do we know this of murder itself? - It is common sense.

Someone asked Rabbah, 'The Governor of my town has ordered me, "Go and kill Ploni and if you don't, I'll kill you"'.He answered him, 'Be murdered rather than murder; who knows that your blood is redder? Perhaps his blood is redder.'

The point of the metaphor should be obvious. The reason for being allowed to break the commandments is to preserve a life. In this case, there's no life being preserved, as someone dies either way. That being the case, the question Rabbah is asking is "Who are you to decide that you will live and the other guy will die?"; how do you know that your blood is any better than his?

So there we have it. Except that it's a little more complicated.

Babylonian Talmud, op cit.

Rabbi Yohcanan said: This was taught for when there are no governmental decrees, but in times when there are governmental decrees, then even for a 'trivial' commandment a person should be killed rather than sin.

Throughout history, the Jewish people have lived in countries and at times where their religious practices have been forbidden by law. In such times, it seems that the big-three-only rule no longer applies. Whether it be the Maccabees in the time of the Seleucids or peasants in Stalin's Russia, in these cases there is a deliberate attempt to attack the religion and the people itself. A different metaprinciple kicks in that overrides the life-preservation one.

Babylonian Talmud, 74a-74b

Rabbi Yochanan said: ... In public, even for a 'trivial' commandment, one must rather be killed than transgress. What is meant by a 'trivial' commandment? Even to change one's shoelace.

And how many make it "public"? ... Ten. ... Jews are required, for it is written. "I will be sanctified among the children of Israel."(Lev 22:32)

So another exception seems to be if the potential sinner is in public. Imagine the scene; a Jewish boy in the Middle Ages, passing through a rough area of town, is captured by a gang of kids, or an overzealous priest. He is dragged out in public, held at knifepoint in the town square, and told: "Insult your mother or I'll kill you", or "Plow a field with an ox and a donkey or else". In these cases, a person should be willing to obey the principle laid out above; that of Kiddush haShem, sanctifying the name of God. This is perhaps the only principle that trumps that of saving a life.

So Judaism does have its idea of martyrdom, but it's very tightly regulated. Too many people in the past have gotten funny ideas and done away with themselves in well-intentioned zeal. It takes a lot to overrule Judaism's belief in the value of life, which itself can overrule almost every other commandment. But, as shown above, it places reasonable limits on that value too.

some of the Talmud translation my own; some from for scanned Talmud pages