'Virality' refers to the phenomenon of one user bringing in another into a product. There are two key types of virality:
a. DIRECT VIRALITY OR REFERRALS: A user invites another user within the product, and the recipient of the invite receives an email or notification informing her about the invite. She accepts the invitation(typically by clicking on a link and going into the product). This is typically the type of virality that is incentivized by most digital products(games offer you coins for inviting a friend, products like Dropbox offering you storage, Paypal in its early days offering money etc.). This can be typically measured by tracking the number of users invited by another user(this can be instrumented while setting up tracking and analytics within your product).
Direct viral coefficient = (Number of users who come in via a referral invite to use a product)/(Number of users who send invites to other users)
b. INDIRECT OR WORD OF MOUTH VIRALITY: In this type of virality, a user tells a friend about a product she likes - and the friend checks out the product by herself without any sort of digital prompting of the sort that a referral mechanism entails. Measuring this can be harder - but if there are strong word of mouth effects, this is absolutely possible to at least estimate. To estimate this, you use an approach similar to what is recommended in the answer to this question on QuantMar: How do I calculate organic contribution from paid marketing campaigns? - and you calculate the ratio of 'organic' users attributable to an increase in paid users, and deduct the direct viral ratio from it.
Indirect viral coefficient = (Organic contribution from paid marketing campaigns) - (Direct viral coefficient).