One of the most important constraints in traditional wireless sensor networks is the limited amount of energy available at each sensor node. The energy consumption is mainly determined by the choice of media access mechanism. SMAC is a typical access mechanism that has drawn much attention in recent years. In WSNs, sensors are usually equipped with capacity-limited battery sources that can sustain longer or shorter period, depending on the energy usage pattern and the activeness level of sensor nodes. To extend the lifetime of the sensor networks, ambient energy resources have been recently exploited in WSNs. Even though solar radiation is known as the superior candidate, its density varies over time depending on many factors such as solar intensity and cloud states, which makes it difficult to predict and utilize the energy efficiently. As a result, how to design an efficient MAC in a solar energy harvesting based WSN becomes a challenging problem. In this paper, we first incorporate a solar energy-harvesting model into SMAC and conduct its performance analysis from a theoretical aspect. Our research works provide a fundamental guideline to design efficient MAC for energy harvesting based WSNs. Our major contribution includes three folders: firstly, we model solar energy harvesting in a photovoltaic cell and then derive the throughput of SMAC in the energy-harvesting based WSNs. Second, we develop a new model based on queuing theory to calculate the average number of energy packets in battery in terms of both duty cycle and throughput. Finally, we form an optimization problem to find a suitable range for the duty cycle to satisfy both quality of service (QoS) and network lifetime requirements.