In order to conduct research in the laboratory, you need a module, and the appropriate trade goods, which can be received as loot from pirates or refined from asteroids.

Upgrading modules costs credits as well as materials. The credit cost is 25% of the module market price plus the laboratory fee of the station. Station's price modifiers have no effect on the price of upgrades. Lab fees increase as you progress further into the game; Astrox station has zero fee, and in each next station the fee is 250 credits higher than in the last one.

Upgrading a module in the laboratory increases that modules level. Each upgrade costs the lab fee in credits, plus 10X the following level of the module in materials. For example, upgrading a cargo module with brake speed modifier will cost the lab fee plus 10 of each material required. Upgrading that same module again with max cargo capacity, will cost the lab fee, plus 20 of each material even though you are only getting one of each upgrade. And so on and so forth.

Pro tip: if you intend to improve several aspects of a module then it's prudent to check the prices on the materials, and start with the aspects that require the most expensive ones. A handful of expensive materials and a lot of cheap ones is much better financially than the reverse. To get to level 10 costs 550 of each material and every 10 levels after cost an added 1000.

lvl added total
10 550 550
20 1550 2100
30 2550 4650
40 3550 8200
50 4550 12750
60 5550 18300
70 6550 24850
80 7550 32400
90 8550 40950
99 8550 49500

Upgrade level effects stack exponentially. For example, an Artifact Safelox X6 has an initial cargo capacity of 1950, and each capacity upgrade gives +2%. Each level increases the capacity based on the capacity of the previous level, so the actual cargo capacity after 100 levels is 14127.07 (approx. +624.46%). The upgrades that reduce certain aspects (fuel burn, turn lag, cooldown) work similarly; reducing the aspect by (1-X)%. So 100 levels of reduction will result in a decrease of 63,4%.

A concrete example is an Artifact Battle Laser - level 0 stats are 187.5 dmg and 1.75 rof (total dmg=107.1429/s). Increasing the Damage to level 20 is 187.5*(1.02)^20=278.6151->159.2086/s; upgrading the ROF to level 20 is 1.75*(0.98)^20=1.168314->160.4877/s which is slightly better (because 1/0.98>1.02). Upgrading damage to level 100 yields 776.2121/s and ROF to 100 yields 807.8964/s, a non-trivial difference of 4% (but at the cost of more energy, which remains at 4.1/shot).

Upgrading from 0 to 99 requires 49,500 of each material, assuming you use the same recipe for all 99 levels.

Module Class Module Type Bonus Refined #1 Mineral #1 Refined #2 Mineral #2
Static Modules Armor Increase Max Armor (+2%) Iron Coring Gradeon Plastix Strand Quazor
Cargo Increase Brake Speed (-1% modifier) Neutron Pod Torim Salt Crystal Adamyte
Increase Max Cargo Capacity (+2%) Goldyte Dust Dynex Plastix Strand Quazor
Engines Increase Max Engine Speed (+1%) Iron Coring Gradeon Neutron Pod Torim
Decrease Fuel Burn Rate (-1%) Calciate Residue Plasite Iron Coring Gradeon
Fuel Tanks Increase Max Fuel Capacity (+2%) Black Stone Lokken Plastix Strand Quazor
Decrease Turn Lag (-1%) Dynex Crystal Dynex Neutron Pod Torim
Energy Regeneration Increase Max Generator Energy (+2%) Black Stone Lokken Dynex Crystal Dynex
Increase Recharge Rate (+1%) Goldyte Dust Dynex Molecular Water Quazor
Shields Increase Max Shield Capacity (+2%)  Dynex Crystal Dynex Plastix Strand Quazor
Targeting Systems Increase Targeting Range (+1%) Dynex Crystal Dynex Magnetic Quartz Torim
Active Modules Missile Launchers Increase Rate Of Fire (-3% cooldown) Plastix Strand Quazor Magnetic Quartz Torim
Increase Missile Damage (+2%)  Calciate Residue Plasite Silveryte Powder Plasite
Decrease Energy Use (-2%) Dynex Crystal Dynex Molecular Water Quazor
Projectile Weapons Increase Rate Of Fire (-2%) Molecular Water Quazor Silveryte Powder Plasite
Increase Projectile Damage (+2%) Copperi Cubex Lokken Silveryte Powder Plasite
Decrease Energy Use (-1%) Dynex Crystal Dynex Aluminium Shard Adamyte
Beam Weapons Decrease Energy Use (-1%) Bio Carbon Gradeon Dynex Crystal Dynex
Increase Laser Damage (+2%) Calciate Residue Plasite Copperi Cubex Lokken
Increase Rate Of Fire (-2%) Salt Crystal Adamyte Blackstone Lokken
Mining Lasers Decrease Energy Use (-1%) Dynex Crystal Dynex Iron Coring Gradeon
Increase Mining Yield (+2%) Salt Crystal Adamyte Magnetic Quartz Torim
Increase Rate Of Fire (-2%) Aluminium Shard Adamyte Molecular Water Quazor
Shield Boosters Increase Max Boost Factor (+1%) Refined Metal Pirate Ship Industrial Parts Pirate Ship
Afterburners Increase Max Boost Factor (+1%) Neutron Pod Torim Industrial Parts Pirate Ship