Development of the neural tube
The early embryo is made up of three germ layers - mesoderm, ectoderm and endoderm. They are differentiated tissues which communicate between themselves via signalling molecules including morphogens. They have specific cell fates -
Mesoderm Endoderm Ectoderm
Both - Muscle, Kidney, Heart, - Gut, Liver - Nervous system
Vertebrates - Skeleton - Lungs - Skin
Invertebrates - Cuticle
(Image 2 - Examples of vertebrate germ layer fates - sourced from Wikipedia)
The entire adult nervous system develops from a structure called the neural tube, which is derived from a sheet of ectoderm (one of the three germ layers). The neural tube begins as a sheet of ectoderm called the neural plate, which folds inwards into the tube via a process called neurulation. The exact process of neurulation varies between species, however the overall process involves the neural plate folding upwards and the edges fusing together, whilst separating from the outer ectoderm, which goes on to form the epidermis. Cells called neural crest cells migrate away from the neural tube at this point, and go on to form the peripheral nervous system, glial cells, pigmented cells etc. The rest of the neural tube forms the central nervous system - the spinal cord and brain.