Muscle mass gaining supplements and weight gain powders vary hugely in their makeup, and whilst the idea behind all of them is to provide a high calorie 'meal' the ratio of protein to carbohydrates and fats will differ based on their function and target user. Many mass gainers will also include secondary added ingredients like creatine, glutamine, recovery agents and in some cases natural testosterone boosters to boost protein synthesis.
In general people who tend to carry body fat easily, even if slim built, are best using protein to carbohydrate rations of 1:1 or 1:2, whilst younger, naturally lean, hard gaining athletes should use ratios of 1:3 or higher.