Steps
Weight train. Don't completely avoid aerobic exercises. You have to experiment to see how they affect your weight gain. A highly recommended book is Championship Bodybuilding by Chris Aceto.
Get more protein. Protein provides the basic building blocks for muscles. It is recommended that you eat your weight in grams. For example, keep your protein between 1-1.5 times your bodyweight. For example, for a 150lb person, he/she would eat between 150g-225g of protein per day. You will not hurt your kidneys by eating this much protein. Unless you have had a kidney removed, your kidneys will not have any problems with this amount.
Drink protein shakes. You can also buy protein in powder form. Whey protein is recommended because it is easily absorbed into the body after workouts. Mix it with milk, yogurt, and/or the fruit of your choice. The majority of your protein intake should come from real food, not protein powders.
Eat carbs, especially oatmeal and pasta. Add extra olive oil. While your protein intake will be higher than before, you should consume more carbohydrates than protein.
Eat smaller portions of food but more often. Whereas before you may have had 3 meals a day, you could have pseudo-meals in between these. As a general rule, eat every 3 hours. Don't wait till dinner to stuff yourself. Spread out your meal amounts evenly. 6-8 meals per day is feasible.
Rid yourself of any preconceived notions that dietary fat is unhealthy. Consume as much unsaturated fat as possible (but avoid saturated and particularly trans fat).
Move a portion of your calorie intake to later in the night, but at least two hours before bedtime.
Drink near a gallon to a gallon and a half of water per day.
Tips
Make your calories count. Don't fill your stomach with "empty" calories such as chips, pretzels and other treats. Instead have some sliced turkey, a handful of peanuts, yogurt, etc. Make every calorie a worthwhile calorie.
Note that some other things such as how much sleep you get and how frequently you get it will affect your metabolism. If you keep a regular sleeping pattern your body will have an easier time storing nutrients as muscle. Also, if you deal with ailments/symptoms such as depression or diabetes, they will affect your ability to gain weight.
Stay away from fast food! While it will fatten you up, it is usually loaded with harmful trans fat. You should choose foods fried in liquid, nonhydrogenated oil. It is equally fattening, and much healthier.
You can eat lots of sweet potatoes.
During the first month of weight training, expect tremendous gains if you are faithful to your schedule. However also expect this to level off after this initiatory period.
Beginner weight trainers are often "afflicted" with DOMS (Delayed Onset Muscle Soreness). This soreness is completely normal and should not prevent one to keep to their weight training schedule. It goes way after a couple days.
For those who are more extreme, you may need to (if you can) drink vegetable oil. (Non-hydrogenated, of course)If this makes you gag, hyperventilate while holding it in your mouth (very rapid breathing strongly suppresses the gag reflex.) Go and buy some liquid Lecithin (a soybean derived ingredient sold at many health food stores). Mix this with vegetable oil in a proportion of 1 part Lecithin to 10 parts oil by weight. This enhances the digestion and absorption of the oil, allowing you to consume as much as 2000 calories (about one glass) without it "going through" or making you nauseated. Don't drink more than ~2000 calories of oil/lecithin in any 9-hour period. Your digestive system can only absorb fat so fast and any more will either go straight through or make you vomit (in either case, defeating the purpose).
You still need to exercise regularly, as the body will need to adjust to the extra weight, or you will feel tired and out of breath with little or no exertion.
You still need to eat healthy if you want to stay healthy. Too much junk food will make you feel tired and depressed, and take away your energy.
Warnings
Protein, when used as a source of energy also costs a lot of energy to convert into usable energy.
Avoid salty and greasy foods.
Avoid trans-fats
If you use large amounts of carbohydrate, be careful about your blood sugar.
Be ready for some funny looks, reactions, and possible "interrogation" if you tell people you're trying to gain fat.
Extremely fast weight gain will cause stretch marks and other skin damage.
extract from: wikihow.com