Most committees specifically require one or two letters from professors who taught you a science class, so for the sake of this post, I will assume the OP HAS to have a science prof letter in addition to whatever, potentially better, PI/employer/whatever letters they may get.
While I would agree that it is generally easier to get good letters from smaller more involved classes, I don't think getting letters from professors of 300 person lecture classes necessarily has to lead to a bad or generic letter. And for most non-science majors at large universities, these may be their only realistic options for science letters. I know several people who have gotten outstanding letters from such classes. The key is:
1) Selectively target classes where the professor is sociable and nice. It's hard to get a good letter from somebody who wants your interaction with them to be as short and efficient as possible. It's infinitely harder to do so with such a person when 300 others are vying for their attention. If you ask upperclassmen, you can often get a good idea of which professors actually make an effort to get to know their students, and those professors who simply won't get close to you no matter how hard you try
2) Go to their office hours occasionally. Ask a question or two. There has to be SOMETHING you can ask even if it's only tangentially related to the material. Then each time try to get to know them a bit more. If you did step 1 right, this should be relatively pain-free and natural. Professors are just people like everyone else. They'll make conversation, and slowly get to know you as more than a face in the sea of 300.
Then...
3) Be a TA! Most 300 person classes have undergraduate teaching assistants. Everyone I know who has gotten a good letter from a professor of these classes went on to be a TA for that professor for multiple semesters. This is where you can really build a strong relationship if you've already done the 2 above steps. You may also get unique opportunities to give guest lectures for them, help them design lessons/curriculum, etc that they can then talk about in your letter.
I know several people at prestigious programs whose only science professor rec letters were from those they took 300+ person classes with, whose interviewers commented about how good their science prof letters were. All of these people followed the 3 steps above.