There are the individual cylinder misfire codes; P0301-P0308, and the random cylinder misfire code P0300 - these are related.
Be sure to thoroughly diagnose and test or the root cause(s) before changing out parts, at great cost and time.
Here are the most common problems that will throw the code. They are presented somewhat in order from most to least likely to be causing the code:
Low Fuel Pressure- If there isn't enough fuel getting to the engine, this will cause combustion to be less than optimal. Diagnosing low fuel pressure can be tricky. Typically, if you do have low fuel pressure, the vehicle will act fine when it doesn't need a lot of fuel. But, it'll sputter and act like it's going to die at speed or under heavy acceleration.
Here's some information on how to tell if you have a bad fuel filter; www.autoMD.com/how-to-guides
Vacuum leak- If the engine has a vacuum leak, it can be very difficult for it to get the right air/fuel mixture. This will cause the cylinders to misfire and it'll throw the P0300. Also, since a vacuum leak almost always affects each cylinder the same, you'll typically get P0300 with it and not any cylinder specific misfire codes.
EGR Problems- If the EGR system is not able to recycle the engine gasses right, it'll throw P0300 fault code.
Cam or Crank Sensors- This one is very unlikely, but it does happen. If the ECU is not getting the right signal from these sensors, the vehicles timing is not going to sync up and it'll misfire.
Low Compression- If there is a leaking head gasket, bent valve, cracked head, etc.. that would cause compression to not be as high as it should, you're going to get P0300. You should also feel the vehicle is down on power as well.