The use of supplemental lighting is an effective way for increasing greenhouse productivity. Recently, using light-emitting diodes (LEDs), capable of precise and quick dimmability, has increased in greenhouses. However, electricity cost of lighting can be significant, and hence, it is necessary to find optimal lighting strategies to minimize supplemental lighting costs. In this paper, we model supplemental lighting in the greenhouse equipped with LEDs as a constrained optimization problem, and we aim at minimizing electricity costs of supplemental lighting. We consider not only plant daily light integral (DLI) need during its photoperiod but also sunlight prediction and variable electricity pricing in our model. We use Markov chain to predict sunlight irradiance throughout the day. By taking sunlight prediction information into account, we avoid supplying more light than plants require. Therefore, our lighting strategy provides sufficient light for plant growth while minimizing electricity costs during the day. We propose an algorithm to find optimal supplemental lighting strategy and evaluate its performance through exhaustive simulation studies using a whole year data and compare it to a heuristic method, which aims to supply a fixed photosynthetic photon flux density (PPFD) to plants at each time-step during the day. We also implement our proposed lighting strategy on Raspberry Pi using Python programming language. Our prediction-based lighting approach shows (on average) about 23% electricity cost reduction compared to a heuristic method throughout the year for a site located at West Virginia.