This is a difficult question. Determining the justice or morality of a given act does not presuppose the existence of a universal morality, ethic, or rule of law and this is partly why the question is so difficult. We are drawn, by the nature of the question, to consider these concepts on a case by case basis.
If a situation exists where two people are trapped on a mountain with only enough supplies for one person to survive, how do we choose who gets to live? Is one person possibly morally preferred (for instance if one person has kids and the other does not)? Does morality really apply in this case?
I'm inclined to agree with the post above and state that for most cases intentions (principled and bald intentions) will determine the morality of the act. But sometimes there is no way to finally determine if an act was right or wrong, just or unjust.
There is a lot of controversy over this -- it's one of the major questions in philosophy, after all.
Some, called "consequentialists" believe that an action is good or bad based on its impacts. So, for example, the utilitarians like Mill would ask whether an action led to a net increase in happiness (however that's defined) for people. If so, it was a good action.
I'm more inclined to go with Kantian views myself. I think that an act is good or bad based on the moral implications of the act. I think that if the purpose behind the act is good, it is a good act regardless of its consequence. As long as a person acts based on principles that would make good universal laws, their actions are good (this is my way of stating the Categorical Imperative).