Vet, then dentist both asap. I wouldn't give her any more grain (if you want to switch it fine) until she is gaining weight. Severely underweight horses can get very sick from getting too much too soon. Sounds like she is used to all the hay (make sure it's top quality, maybe add something else "hay based". I have heard lots of studies recommending alfalfa for starvation cases, maybe add pellets/cubes (soaked). I would do that then up grain then add beet pulp then up grain again, maybe corn oil or something. Make ANY changes VERY slowly. 300lbs underweight I would definitely be working with a vet on. I know a horse who was severely emaciated with a VERY bad impaction, luckily she pulled through on her own, but there was pretty much nothing we could do for her due to her health at the time she was not even an option for surgery. Literally make changes by the handful over the course of weeks.
Vet can also advise for deworming.