Weight gain comes down to this formula;
The chances are, you have a fast-burning metabolism and are predominantly an ectomorphic body type.
You will need to eat large quantities of food, and eating it often.
See the Weight Gaining Calculator for exact calculations on daily calories and nutrient levels.
This MUST be combined with a good weight training program, otherwise ALL that food will be stored as fat.
Don't ever miss meals (such as breakfast) - it is important to eat often. Whey protein and weight gain powders can help - simply because it's easier to consume the calories in a liquid form than it is to chew your way through them.
Sometimes you may need to eat so much, that it feels like you're eating all the time - and certain foods may start to become irritating.
If you don't get much sleep, it's time to start sleeping more - to slow down, and become a little less active. If you do cardiovascular exercise a lot it may be time to slow down here as well - no more than 20 minutes 3 times a week.
There are many quick-fix hard-sell weight gain programs out there. One of the more superior programs is Body Building Revealed.
This program offers the complete package - diet, a multitude of training programs, supplementation (without bias) and a full on-line support structure.
Just because you are trying to gain weight instead of losing it - is no excuse to throw good nutritional advice to the wind.
The best ratio of nutrients may actually surprise you. The diet will be higher in protein (typically about 1 gram per pound of weight), and about 30% fat - the remainder will be carbs (good whole carbs such as oatmeal, brown rice, vegetables, etc).
If you combine this with a good weight training program, your body will begin to build muscle. Most people often find a reasonable initial muscle gain but can sometimes hit a plateau after a few months.
It can be difficult to maintain the right balance of building muscle, but not overdoing caloric input and gaining plenty of fat as well. Virtually everyone gains fat alongside the muscle - this is normal.
Trying to gain weight requires a good deal of commitment - both in time, willpower, and money. All that food is expensive, and sometimes it's more convenient to skip meals or snacks when you need to be eating.
It does help if your life is already routine or well-structured. You can then fit all your meals into your routine.