Tail behavior of the product of two dependent random variables with applications to risk theory