Difference in usage of "rock" and "rocks"
Solution 1:
Both sentences are grammatically correct, but in general the first is true and the second false. “Sedimentary rock” refers to sedimentary rock structures or sedimentary rocks in general; “sedimentary rocks” refers to pieces of sedimentary rock. The first statement suggests that fossils may be found in sedimentary rock, which typically is so. The second statement suggests that if I have a sedimentary rock it will have a fossil in it. But most sedimentary rocks – for example, most pieces of limestone gravel – do not have fossils in them.
Solution 2:
Rocks is used when you have a countable group of rocks. For instance:
I found this coin under the rocks over there.
Rock can also be used in an uncountable sense when it refers to a big mass of rock, or "rock" as a general concept.
Rock is a common building material.
Your example sounds like it's a general rule rather than a specific finding, which indicates that it's talking about rock as a concept. Thus the correct usage is:
Fossils are found in sedimentary rock.
If you were talking about fossils that were actually in individual rocks, it might be possible to turn the sentence around, but that does not fit your specific example.
I found these fossils in those rocks over there.
Solution 3:
In general, the other answers are correct in that rocks usually refers to individual discrete rocks. However,
Fossils are found in sedimentary rocks.
could also refer to multiple types of sedimentary rock. For example,
Fossils are found in sedimentary rocks, such as chalk and limestone.
sounds correct. It might be less ambiguous to say ... sedimentary rock types ... explicitly, though.