  This paper provides a characterization of all possible dependency structures
between two stochastically ordered random variables. The answer is given in
terms of copulas that are compatible with the stochastic order and the marginal
distributions. The extremal values for Kendall's $\tau$ and Spearman's $\rho$
for all these copulas are given in closed form. We also find an explicit form
for the joint distribution with the maximal entropy. A multivariate extension
and a generalization to random elements in partially ordered spaces are also
provided.
