At the start of the study, patients will be informed which dose level they will be treated with. On day 1, patients will have a physical exam and several blood draws including draws to measure the level of valproic acid in their body. Patients will start your whole brain radiation and also at the same time start the valproic acid and temozolomide pills. Patients will be asked to take the valproic acid pills every 12 hours and the temozolomide pills once daily. Patients will not need to come to the center for that but will need to come to the center to receive you whole brain radiation for 3 weeks (on weekdays, excluding holidays). Radiation therapy will not be administered on weekends but patients will still take their pills for the whole 3 weeks from starting the radiation.