The introduction of variable renewable energy (VRE) has been increasing to reduce CO2 emissions. With the rapid introduction of VREs, it is necessary to take measures against excess power generation to stabilize the power system. Hydrogen production using VRE surplus electricity that called Power-to-Gas (P2G), is attracting attention as a new means. However, it has been reported that P2G is low economically viable when introduced as a countermeasure for VRE surplus power, and improving the economics of P2G systems is the issue. In this study, two methods of procuring electricity to the P2G plant will be used: one is electricity generated by photovoltaic (PV) panels annexed the P2G plant, and the other is electricity purchased from the Electric Power Exchange (EPX). By using these two methods together, the authors will increase the operating ratio of the P2G plant and study the economics when producing hydrogen in a stable manner. The target P2G plant consists of a 1 MW proton exchange membrane electrolyzer cell (PEMEC), a hydrogen storage tank, and 3 MW PV. In this study, three conditions are assumed for the power used for P2G: only EPX, only PV, and the combination of EPX and PV. For each case, the economically optimal operation that minimizes the operating cost is derived using mixed integer linear programming. Results of Japan's FY2019 estimates, it was confirmed that the hydrogen production by using both PV and EPX to procure electricity for the P2G system has the effect of lowering the unit price of hydrogen production by 1.51-15.1 yen/Nm3 compared with the case of PV only.