voltage regulator prevent back flow of current?
You must advise battery type and specification.
eg lead acid or NiCd or MimH or LiIon or ...?
How many mAh capacity?


  I have solar cell with peak volt=9V and I=300mA. I want to charge 6V battery. I'm thinking to put L7809 voltage regulator to prevent spike in voltage of solar cell and at night time there will low voltage at solar panel.


You will not harm the panel by charging a lower voltage panel. The battery will "clamp" the panel output to the battery voltage and supply whatever current it cam.

You should add a diode between panel and battery to prevent "backflow" when panel voltage is lower than battery voltage. You do NOT need a regulator for basic charging except if the battery is so small that it will not toilerate a 300 mA charge rate - which is unlikely. You MAY need a regulator to stop the battery from overcharging.

The panel will supply about 300 mA into the battery in full midday sun when pointed at the sun and less or much less when cloudy, not midday or not pointed directly at the sun. If the battery has capacity below about 2000 mAh it MAY be fully charged in less than one day. If 2000 mAh it will not fully charge in one day from "flat". 

Where are you located? What use will be made of the battery (daily discharged fully or ...?) These factors affect the answer.