Reliable knowledge of solar radiation is an essential requirement for designing and planning solar energy systems. Thus, this paper presents a novel hybrid model for predicting hourly global solar radiation using random forests technique and firefly algorithm. Hourly meteorological data are used to develop the proposed model. The firefly algorithm is utilized to optimize the random forests technique by finding the best number of trees and leaves per tree in the forest. According to the results, the best number of trees and leaves per tree is 493 trees and one leaf per tree in the forest. Three statistical error values, namely, root mean square error, mean bias error, and mean absolute percentage error are used to evaluate the proposed model for the internal and external validation. Moreover, the results of the proposed model are compared with conventional random forests model, conventional artificial neural network and optimized artificial neural network model by firefly algorithm to show the superiority of the proposed hybrid model. Results show that the root mean square error, mean absolute percentage error, and mean bias error values of the proposed model are 18.98%, 6.38% and 2.86%, respectively. Moreover, the proposed random forests model shows better performance as compared to the aforementioned models in terms of prediction accuracy and prediction speed. (C) 2017 Elsevier Ltd. All rights reserved.