This paper provides empirical evidences that corporate firms risk assessment could benefit from taking quantitatively into account the network of interactions among firms. Indeed, the structure of interactions between firms is critical to identify risk concentration and the possible pathways of propagation of financial distress. In this work, we consider the interactions by investigating a large proprietary dataset of payments between Italian firms. We first characterise the topological properties of the payment networks, and then we focus our attention on the relation between the networks and the risk of firms. Our main finding is to document the existence of an homophily of risk, i.e. the tendency of firms with similar risk profile to be statistically more connected among themselves. This effect is observed when considering both pairs of firms and communities or hierarchies identified in the network. We leverage this knowledge to demonstrate that network properties of a node can be used to predict the missing rating of a firm.